Skip to contentSkip to conversation

nft-arp: wrong condition in parse_payload

PATCH In review Giuseppe Longo 2 participants 2 messages Mar 7, 2014 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nft-arp: wrong condition in parse_payload

the current condition doesn't permit to parse ip addresses when they should be.
Obviously they are not printed.

arptables-compat -A INPUT -s 1.1.1.1 -i eth0 -j ACCEPT arptables-compat -L

Chain INPUT (policy ACCEPT)
target prot opt source destination
-j ACCEPT -i eth0

---
 iptables/nft-arp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
iptables/nft-arp.c +1 -1
index 1af7202..3af1b4b 100644
@@ -345,7 +345,7 @@ static void nft_arp_parse_payload(struct nft_rule_expr_iter *iter,
 			fw->arp.invflags |= ARPT_INV_ARPOP;
 		break;
 	default:
-		if (!fw->arp.arhln)
+		if (fw->arp.arhln < 0)
 			break;
 
 		if (offset == sizeof(struct arphdr) + fw->arp.arhln) {
Signature · 1 line
1.8.3.2
#1 lore raw
Quoted 10 lines · Giuseppe Longo

the current condition doesn't permit to parse ip addresses when they should be.
Obviously they are not printed.

arptables-compat -A INPUT -s 1.1.1.1 -i eth0 -j ACCEPT arptables-compat -L

Chain INPUT (policy ACCEPT)
target prot opt source destination
-j ACCEPT -i eth0

Also applied, good that you're giving testing to this to catch bugs. Thanks.