[PATCH v2 4/8] tests: check decoding of NETLINK_SOCK_DIAG AF_PACKET messages

Dmitry V. Levin ldv at altlinux.org
Fri Jun 16 00:56:57 UTC 2017


On Thu, Jun 15, 2017 at 12:30:50PM +0800, JingPiao Chen wrote:
> * tests/netlink_sock_diag.c: Include <linux/if_ether.h>
> and <linux/packet_diag.h>.
> (test_packet_diag_req, test_packet_diag_msg): New functions.
> (main): Use them.

Thanks, applied with the following minor changes:

> +	*req = (struct packet_diag_req) {
> +		.sdiag_family = AF_PACKET,
> +		.sdiag_protocol = ETH_P_LOOP,
> +		.pdiag_ino = 0xfacefeed,
> +		.pdiag_show = PACKET_SHOW_INFO,
> +		.pdiag_cookie = { 0xdeadbeef, 0xbadc0ded },
> +	};

As pdiag_cookie is the last field of the structure, removed trailing comma.

> +	*msg = (struct packet_diag_msg) {
> +		.pdiag_family = AF_PACKET,
> +		.pdiag_type = SOCK_STREAM,
> +		.pdiag_num = 0xbadc,
> +		.pdiag_ino = 0xfacefeed,
> +		.pdiag_cookie = { 0xdeadbeef, 0xbadc0ded },
> +	};

Likewise.


-- 
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/20170616/40edea3c/attachment.bin>


More information about the Strace-devel mailing list