]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
datatype: add stolen verdict
authorFlorian Westphal <fw@strlen.de>
Tue, 12 Jun 2018 16:39:13 +0000 (18:39 +0200)
committerFlorian Westphal <fw@strlen.de>
Tue, 12 Jun 2018 16:43:00 +0000 (18:43 +0200)
using fwd statement causes crash when using nft trace:

 trace id ddbbaae2 netdev vpn ingress_out packet: iif "enp2s0" ether saddr 78:54:00:29:bb:aa ether daddr 52:54:00:01:53:9f ip saddr 85.14.236.41 ip daddr 17.25.63.98 ip dscp cs0 ip ecn not-ect ip ttl 64 ip id 49036 ip length 84 icmp type echo-reply icmp code 0 icmp id 16947 icmp sequence 4
 trace id ddbbaae2 netdev vpn ingress_out rule ip saddr 85.14.236.41 nftrace set 1 (verdict continue)
 trace id ddbbaae2 netdev vpn ingress_out rule ip saddr 85.14.236.41 ether saddr set aa:bb:00:18:cc:dd ether daddr set 00:00:5e:00:00:11 fwd to "enp1s0"
 BUG: invalid verdict value 2
 nft: datatype.c:282: verdict_type_print: Assertion `0' failed.

ADd stolen verdict (2) and remove the BUG statement.

Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1261
Signed-off-by: Florian Westphal <fw@strlen.de>
src/datatype.c

index c77d228e95a1efb7211d913591a4170ffb767036..209044539bb84b92e2e83645a07076ec48dc89e5 100644 (file)
@@ -280,8 +280,12 @@ static void verdict_type_print(const struct expr *expr, struct output_ctx *octx)
                case NF_QUEUE:
                        nft_print(octx, "queue");
                        break;
+               case NF_STOLEN:
+                       nft_print(octx, "stolen");
+                       break;
                default:
-                       BUG("invalid verdict value %u\n", expr->verdict);
+                       nft_print(octx, "unknown verdict value %u", expr->verdict);
+                       break;
                }
        }
 }