diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2023-08-03 17:19:52 +1000 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2023-08-04 01:28:29 +0200 |
commit | a3093182758eb58116eb5b400f3c44acef571056 (patch) | |
tree | 9f5eb603db9227fa50b01278555780b8ccca9cf4 /icmp.c | |
parent | 99ddd7ce837f589998f2bf8ce91c0bbe74a319a0 (diff) | |
download | passt-a3093182758eb58116eb5b400f3c44acef571056.tar passt-a3093182758eb58116eb5b400f3c44acef571056.tar.gz passt-a3093182758eb58116eb5b400f3c44acef571056.tar.bz2 passt-a3093182758eb58116eb5b400f3c44acef571056.tar.lz passt-a3093182758eb58116eb5b400f3c44acef571056.tar.xz passt-a3093182758eb58116eb5b400f3c44acef571056.tar.zst passt-a3093182758eb58116eb5b400f3c44acef571056.zip |
netlink: Add nl_foreach_oftype to filter response message types
In most cases where processing response messages, we expect only one type
of message (excepting NLMSG_DONE or NLMSG_ERROR), and so we need a test
and continue to skip anything else. Add a helper macro to do this.
This also fixes a bug in nl_get_ext_if() where we didn't have such a test
and if we got a message other than RTM_NEWROUTE we would have parsed
its contents as nonsense.
Also add a warning message if we get such an unexpected message type, which
could be useful for debugging if we ever hit it.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'icmp.c')
0 files changed, 0 insertions, 0 deletions