Skip to contentSkip to conversation

nft-shared: skip check for jumpto if cs->target is unset

PATCH New Pablo Neira Ayuso 1 participant 1 message Apr 15, 2020 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 nft-shared: skip check for jumpto if cs->target is unset

The command_jump() function leaves cs->target as NULL if the target is not found. Check if the cs->jumpto string mismatches only in this case.

https://bugzilla.netfilter.org/show_bug.cgi?id=1422

---
 extensions/libxt_NOTRACK.t | 3 +--
 iptables/nft-shared.c      | 3 ++-
 2 files changed, 3 insertions(+), 3 deletions(-)
extensions/libxt_NOTRACK.t +1 -2
index 585be82d56ec..27c4734ff497 100644
@@ -1,4 +1,3 @@
 :PREROUTING,OUTPUT
 *raw
-# ERROR: cannot find: iptables -I PREROUTING -t raw -j NOTRACK
-#-j NOTRACK;=;OK
+-j NOTRACK;=;OK
iptables/nft-shared.c +2 -1
index 426765641cff..5192e36358b7 100644
@@ -1013,7 +1013,8 @@ bool nft_ipv46_rule_find(struct nft_handle *h, struct nftnl_rule *r, void *data)
 		goto out;
 	}
 
-	if (strcmp(cs->jumpto, this.jumpto) != 0) {
+	if ((!cs->target || !this.target) &&
+	    strcmp(cs->jumpto, this.jumpto) != 0) {
 		DEBUGP("Different verdict\n");
 		goto out;
 	}
Signature · 1 line
2.11.0