From mboxrd@z Thu Jan 1 00:00:00 1970 From: Petr Vorel Date: Fri, 17 Apr 2020 15:25:06 +0200 Subject: [LTP] [PATCH v4 2/2] net/route: Add netlink based route change gw/dest tests In-Reply-To: <20200416141909.GA16790@dell5510> References: <20200414152412.8278-1-pvorel@suse.cz> <20200414152412.8278-3-pvorel@suse.cz> <20200416141909.GA16790@dell5510> Message-ID: <20200417132506.GA3373@dell5510> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ltp@lists.linux.it 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