]> granicus.if.org Git - strace/commit
Robustify netlink response parsers
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 30 Jan 2016 23:50:54 +0000 (23:50 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 3 Feb 2016 12:43:17 +0000 (12:43 +0000)
commit3c86e0ea5d2c1a528d91d76d27c8ae83c02cf2b9
treed053ddf3fa6272f9fcb8c8ce2cf764316708e2cd
parentcc09ba1a8406d4765979a679520c4c164b814a13
Robustify netlink response parsers

* socketutils.c (inet_parse_response, unix_parse_response): Change
return type from bool to int, return -1 on all parse errors except
inode mismatch.
(receive_responses): Stop on the first nlmsg_type that is not
SOCK_DIAG_BY_FAMILY, also stop when the parser returns -1.
* tests/netlink_inet_diag.c (check_responses): Stop on short messages,
on first nlmsg_type that is not SOCK_DIAG_BY_FAMILY, print more verbose
diagnostics for NLMSG_ERROR.
* tests/netlink_unix_diag.c (check_responses): Likewise.
socketutils.c
tests/netlink_inet_diag.c
tests/netlink_unix_diag.c