[LTP] [PATCH v4 2/2] net/route: Add netlink based route change gw/dest tests

Petr Vorel pvorel@suse.cz
Fri Apr 17 15:25:06 CEST 2020


Hi Alexey,

> > > +struct ip_addr {
> > > +	char ip[INET6_ADDRSTRLEN];

> > What about adding 'struct addrinfo' here, and use it instead of ip
> > string manipulation during the test?
> Hm, probably good idea.
> String manipulation is needed for creating destination (char dst[INET6_ADDRSTRLEN]).
> But that should be done during setup as well => would it be better to have also
> struct ip_addr *dst?
OK, I got your point. Replace IP represented in string with union with binary
IP:
	union {
		in_addr_t ip;
		struct in6_addr ip6;
	}

inet_pton() than would be run in the setup. Current design is a result of the
original idea that IP's will be generated by tst_ipaddr_un() C implementation
the way shell tests are working. But then I change this C test to use limited
number of addresses repeating more times, so it makes more sense to prepare
everything in the setup.

+ I haven't prepared variant for changing iface.
I'll either finish it or remove struct iface for now.

The rest of your comments I've implemented.

Kind regards,
Petr


More information about the ltp mailing list