[LTP] [RFC PATCH v4 2/3] network: Add tool for setup IP variables

Alexey Kodanev alexey.kodanev@oracle.com
Mon Apr 10 12:36:28 CEST 2017


Hi,
On 04/05/2017 11:44 PM, Petr Vorel wrote:
> ...
> +static int get_ipv4_info(struct in_addr *lIp, struct in_addr *rIp, int prefix)
> +{
> +	vars.ipv4_network = get_ipv4_network(lIp->s_addr, prefix,
> +		FLAG_GET_NETWORK);
> +	if (strcmp(vars.ipv4_network, get_ipv4_network(rIp->s_addr, prefix,
> +			FLAG_GET_NETWORK))) {
> +		fprintf(stderr, "Please use the same network for both IP addresses\n");
> +		return -1;

Thinking more about this, we shouldn't put such restrictions on
network configuration as well. There could be more complex setup
involving routers, NAT, etc.

Thanks,
Alexey



More information about the ltp mailing list