From 5b1fb140a0db0e14d036face850dad3a4e209901 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Mon, 8 Feb 2021 15:54:44 +0100 Subject: trace: do not remove icmp type from packet dump As of 0.9.8 the icmp type is marked as a protocol field, so its elided in 'nft monitor trace' output: icmp code 0 icmp id 44380 .. Restore it. Unlike tcp, where 'tcp sport' et. al in the dump will make the 'ip protocol tcp' redundant this case isn't obvious in the icmp case: icmp type 8 code 0 id ... Reported-by: Martin Gignac Fixes: 98b871512c4677 ("src: add auto-dependencies for ipv4 icmp") Signed-off-by: Florian Westphal --- src/netlink.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/netlink.c') diff --git a/src/netlink.c b/src/netlink.c index ec2dad29..c3887d5b 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -1859,7 +1859,9 @@ next: pctx->pbase == PROTO_BASE_INVALID) { payload_dependency_store(pctx, stmt, base - stacked); } else { - payload_dependency_kill(pctx, lhs, ctx->family); + /* Don't strip 'icmp type' from payload dump. */ + if (pctx->icmp_type == 0) + payload_dependency_kill(pctx, lhs, ctx->family); if (lhs->flags & EXPR_F_PROTOCOL) payload_dependency_store(pctx, stmt, base - stacked); } -- cgit v1.2.3