[PATCH 15/27] tests: check decoding of NETLINK_ROUTE ifinfomsg netlink attribute
JingPiao Chen
chenjingpiao at gmail.com
Wed Aug 16 15:45:51 UTC 2017
On Wed, Aug 16, 2017 at 08:55:13AM +0300, Dmitry V. Levin wrote:
> On Tue, Aug 15, 2017 at 12:41:23PM +0800, JingPiao Chen wrote:
> > * tests/nlattr_ifinfomsg.c: New file.
> > * tests/gen_tests.in (nlattr_ifinfomsg): New entry.
> > * tests/pure_executables.list: Add nlattr_ifinfomsg.
> > * tests/.gitignore: Likewise.
>
> Why this patch is 15/27? Isn't it expected to follow the change it tests,
> that is, 02/27? I reordered commits to this effect.
I think it's easy to fix the code. I will reorder before send to mailing list
next time.
>
> [...]
> > +#include "tests.h"
> > +
> > +#include <stdio.h>
> > +#include <stdint.h>
> > +#include <sys/socket.h>
> > +#include <linux/if.h>
> > +#include <linux/if_arp.h>
> > +#include "test_nlattr.h"
> > +#include <linux/rtnetlink.h>
> > +
> > +#ifdef HAVE_IF_INDEXTONAME
> > +/* <linux/if.h> used to conflict with <net/if.h> */
> > +extern unsigned int if_nametoindex(const char *);
> > +# define IFINDEX_LO (if_nametoindex("lo"))
> > +#else
> > +# define IFINDEX_LO 1
> > +#endif
>
> No, I cannot tolerate this cut-n-paste any longer.
>
> Added ifindex_lo function with IFINDEX_LO_STR macro to libtests,
> changed all tests to use them instead.
--
JingPiao Chen
More information about the Strace-devel
mailing list