[PATCH 15/27] tests: check decoding of NETLINK_ROUTE ifinfomsg netlink attribute

Dmitry V. Levin ldv at altlinux.org
Wed Aug 16 05:55:13 UTC 2017


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.

[...]
> +#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.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20170816/e4d362b0/attachment.bin>


More information about the Strace-devel mailing list