[PATCH v4 4/6] tests: check decoding of netlink protocol

Dmitry V. Levin ldv at altlinux.org
Sun Jun 19 23:42:25 UTC 2016


On Fri, Jun 17, 2016 at 04:29:56PM +0000, Fabien Siron wrote:
[...]
> +	const void *const efault = tail_alloc(sizeof(struct nlmsghdr) - 1);
[...]
> +	sendto(fd, efault, sizeof(struct nlmsghdr), MSG_DONTWAIT, NULL, 0);
> +
> +	printf("sendto(%d, %#lx, %u, MSG_DONTWAIT, NULL, 0) = -1 "
> +	       "EFAULT (Bad address)\n", fd, (unsigned long) efault,
> +	       (unsigned) sizeof(struct nlmsghdr));

efault is a pointer; the natural format of printing pointers is %p.
No need to print "Bad address" verbatim, use %m format string instead.

[...]
> +++ b/tests/netlink_parsing.test
> @@ -0,0 +1,48 @@
> +#!/bin/sh
> +#
> +# Check decoding of protocol:portid pairs associated with socket
> +# descriptors

This comment has to be updated.

[...]
> +# strace -yy is implemented using /proc/self/fd
> +[ -d /proc/self/fd/ ] ||
> +	framework_skip_ '/proc/self/fd/ is not available'

As the test doesn't use -yy feature, this check is not needed.


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


More information about the Strace-devel mailing list