Skip to contentSkip to conversation

arptables bug.

DISCUSSION Applied Steven Jan Springl 3 participants 4 messages Jan 5, 2013 – Jan 7, 2013 netfilter

lore
Share & tools
lore
#0 lore raw

Hello

I am using arptables v0.0.3.4 in Debian Squeeze.

Issuing command:

aptables -A INPUT -i eth0 --opcode ! 1 -j DROP

Then issuing command arptables-save produces the following:

-A INPUT -j DROP -i eth0 --opcode 1

The "!" is missing from the opcode.

Regards.

Steven.

#1 lore raw
Quoted 6 lines · Steven Jan Springl

Hello

I am using arptables v0.0.3.4 in Debian Squeeze.

Issuing command:

Quoted 7 lines

aptables -A INPUT -i eth0 --opcode ! 1 -j DROP

Then issuing command arptables-save produces the following:

-A INPUT -j DROP -i eth0 --opcode 1

The "!" is missing from the opcode.

Patch attached to fix it.

Bart, could you please apply this to your git repo? Thanks.

Quoted 1 line

From b83962f7ad5b65468d6e1ce099e970afd336c3b1 Mon Sep 17 00:00:00 2001

From: Pablo Neira Ayuso <[email protected]>
Date: Mon, 7 Jan 2013 04:14:22 +0100
Subject: [PATCH] arptables: fix ! --opcode 1 in -L -n output

The imbalance in the array is likely to fix the negation of:

--h-type, --proto-type, -i and -o.

---
 userspace/arptables/arptables.c |    1 +
 1 file changed, 1 insertion(+)
userspace/arptables/arptables.c +1 -0
index 2f048c7..29ccd22 100644
@@ -204,6 +204,7 @@ static int inverse_for_options[NUMBER_OF_OPT] =
 /* 2 */ ARPT_INV_SRCDEVADDR,
 /* 3 */ ARPT_INV_TGTDEVADDR,
 /* -l */ ARPT_INV_ARPHLN,
+	0,
 /* 4 */ ARPT_INV_ARPOP,
 /* 5 */ ARPT_INV_ARPHRD,
 /* 6 */ ARPT_INV_ARPPRO,
Signature · 1 line
1.7.10.4
#2 lore raw

Hi Pablo,

I've applied (a slightly different version of) your patch, thanks. I'll make a new release somewhere this week.

cheers,
Bart

Op 7/01/2013 4:24, Pablo Neira Ayuso schreef:

Quoted 17 lines · Steven Jan Springl
Quoted 6 lines

Hello

I am using arptables v0.0.3.4 in Debian Squeeze.

Issuing command:

Quoted 7 lines

aptables -A INPUT -i eth0 --opcode ! 1 -j DROP

Then issuing command arptables-save produces the following:

-A INPUT -j DROP -i eth0 --opcode 1

The "!" is missing from the opcode.

Patch attached to fix it.

Bart, could you please apply this to your git repo? Thanks.

#3 lore raw
In reply to Pablo Neira Ayuso
Quoted 11 lines · On Monday 07 Jan 2013 03:24:15 Pablo Neira Ayuso wrote:
Quoted 10 lines · Steven Jan Springl

Hello

I am using arptables v0.0.3.4 in Debian Squeeze.

Issuing command:

aptables -A INPUT -i eth0 --opcode ! 1 -j DROP

Then issuing command arptables-save produces the following:

Quoted 7 lines
Quoted 3 lines

-A INPUT -j DROP -i eth0 --opcode 1

The "!" is missing from the opcode.

Patch attached to fix it.

Bart, could you please apply this to your git repo? Thanks.

Pablo

I can confirm that the patch corrects the bug.

Thanks.

Steven.