Skip to contentSkip to conversation

nft-arp: remove wrong conditions

PATCH Applied Giuseppe Longo 2 participants 2 messages Aug 8, 2014 – Aug 11, 2014 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nft-arp: remove wrong conditions

Removes wrong conditions in flags translating functions that doesn't permit to delete rule with inverse flags set.

For instance, the following command doesn't remove the rule:
arptables-compat -D INPUT -i ! eth1 -j ACCEPT

---
 iptables/nft-arp.c | 6 ------
 1 file changed, 6 deletions(-)
iptables/nft-arp.c +0 -6
index c1cbbc0..c3cfee9 100644
@@ -155,9 +155,6 @@ static uint8_t arpt_to_ipt_flags(uint16_t invflags)
 	if (invflags & ARPT_INV_ARPPRO)
 		result |= IPT_INV_PROTO;
 
-	if (invflags & ARPT_INV_MASK)
-		result |= IPT_INV_MASK;
-
 	return result;
 }
 
@@ -257,9 +254,6 @@ static uint16_t ipt_to_arpt_flags(uint8_t invflags)
 	if (invflags & IPT_INV_PROTO)
 		result |= ARPT_INV_ARPPRO;
 
-	if (invflags & IPT_INV_MASK)
-		result |= ARPT_INV_MASK;
-
 	return result;
 }
 
Signature · 1 line
1.8.3.2
maintainer Applied
#1 lore raw
Quoted 5 lines · Giuseppe Longo

Removes wrong conditions in flags translating functions that doesn't permit to delete rule with inverse flags set.

For instance, the following command doesn't remove the rule:
arptables-compat -D INPUT -i ! eth1 -j ACCEPT

Applied, thanks.

There's another bug in arptables-compat:

arptables: Bad rule (does a matching rule exist in that chain?)

It doesn't say that if you try to delete an unexistent rule.

Please, have a look at it and fix it, thanks.