All of lore.kernel.org
 help / color / mirror / Atom feed
* iptables-1.4.1: ip6tables -L prints network mask instead of prefix length
@ 2008-06-10 11:49 Petr Pisar
  2008-06-10 12:06 ` Jan Engelhardt
  0 siblings, 1 reply; 4+ messages in thread
From: Petr Pisar @ 2008-06-10 11:49 UTC (permalink / raw)
  To: netfilter-devel

Hello,

I found regression between iptables 1.4.0 and 1.4.1-rc1 (also in
1.4.1). The "ip6tables -nL" prints source and destination addresses in
NETWORK/NETMASK instead of NETWORK/PREFIXLEN as used in iptables 1.4.0.

This doesn't happen if the PREFIXLEN is 0 (i.e. ::/0).

Example:

# /tmp/iptables-1.4.0/ip6tables -nL FORWARD
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
netall-in  all      ::/0                 2002:93fb:1712::/48
netall-out  all      2002:93fb:1712::/48  ::/0

# /tmp/iptables-1.4.1-rc1/ip6tables -nL FORWARD 
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
netall-in  all      ::/0                 2002:93fb:1712::/ffff:ffff:ffff:: 
netall-out  all      2002:93fb:1712::/ffff:ffff:ffff::  ::/0

-- Petr



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: iptables-1.4.1: ip6tables -L prints network mask instead of prefix length
  2008-06-10 11:49 iptables-1.4.1: ip6tables -L prints network mask instead of prefix length Petr Pisar
@ 2008-06-10 12:06 ` Jan Engelhardt
  2008-06-10 13:01   ` Petr Pisar
  2008-06-10 13:18   ` Patrick McHardy
  0 siblings, 2 replies; 4+ messages in thread
From: Jan Engelhardt @ 2008-06-10 12:06 UTC (permalink / raw)
  To: Petr Pisar; +Cc: netfilter-devel


On Tuesday 2008-06-10 13:49, Petr Pisar wrote:
>Hello,
>
>I found regression between iptables 1.4.0 and 1.4.1-rc1 (also in
>1.4.1). The "ip6tables -nL" prints source and destination addresses in
>NETWORK/NETMASK instead of NETWORK/PREFIXLEN as used in iptables 1.4.0.
>
>This doesn't happen if the PREFIXLEN is 0 (i.e. ::/0).

(It does not happen if PREFIXLEN is a multiple of 32.)
Fix below.

commit f52d74a1a83c4fa30fcab8b318d325bb3c9b5535
Author: Jan Engelhardt <jengelh@medozas.de>
Date:   Tue Jun 10 14:05:21 2008 +0200

ip6tables: fix printing of ipv6 network masks
    
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
 xtables.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xtables.c b/xtables.c
index 8241687..a97bdaa 100644
--- a/xtables.c
+++ b/xtables.c
@@ -1011,10 +1011,10 @@ static int ip6addr_prefix_length(const struct in6_addr *k)
 	unsigned int bits = 0;
 	uint32_t a, b, c, d;
 
-	a = k->s6_addr32[0];
-	b = k->s6_addr32[1];
-	c = k->s6_addr32[2];
-	d = k->s6_addr32[3];
+	a = ntohl(k->s6_addr32[0]);
+	b = ntohl(k->s6_addr32[1]);
+	c = ntohl(k->s6_addr32[2]);
+	d = ntohl(k->s6_addr32[3]);
 	while (a & 0x80000000U) {
 		++bits;
 		a <<= 1;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: iptables-1.4.1: ip6tables -L prints network mask instead of prefix length
  2008-06-10 12:06 ` Jan Engelhardt
@ 2008-06-10 13:01   ` Petr Pisar
  2008-06-10 13:18   ` Patrick McHardy
  1 sibling, 0 replies; 4+ messages in thread
From: Petr Pisar @ 2008-06-10 13:01 UTC (permalink / raw)
  To: netfilter-devel

On 2008-06-10, Jan Engelhardt <jengelh@medozas.de> wrote:
>
> On Tuesday 2008-06-10 13:49, Petr Pisar wrote:
>>Hello,
>>
>>I found regression between iptables 1.4.0 and 1.4.1-rc1 (also in
>>1.4.1). The "ip6tables -nL" prints source and destination addresses in
>>NETWORK/NETMASK instead of NETWORK/PREFIXLEN as used in iptables 1.4.0.
>>
>>This doesn't happen if the PREFIXLEN is 0 (i.e. ::/0).
>
> (It does not happen if PREFIXLEN is a multiple of 32.)
> Fix below.
>
> commit f52d74a1a83c4fa30fcab8b318d325bb3c9b5535
> Author: Jan Engelhardt <jengelh@medozas.de>
> Date:   Tue Jun 10 14:05:21 2008 +0200
>
This patch makes ip6tables much better. Works for me. Thanks.

-- Petr



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: iptables-1.4.1: ip6tables -L prints network mask instead of prefix length
  2008-06-10 12:06 ` Jan Engelhardt
  2008-06-10 13:01   ` Petr Pisar
@ 2008-06-10 13:18   ` Patrick McHardy
  1 sibling, 0 replies; 4+ messages in thread
From: Patrick McHardy @ 2008-06-10 13:18 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Petr Pisar, netfilter-devel

Jan Engelhardt wrote:
> On Tuesday 2008-06-10 13:49, Petr Pisar wrote:
>> Hello,
>>
>> I found regression between iptables 1.4.0 and 1.4.1-rc1 (also in
>> 1.4.1). The "ip6tables -nL" prints source and destination addresses in
>> NETWORK/NETMASK instead of NETWORK/PREFIXLEN as used in iptables 1.4.0.
>>
>> This doesn't happen if the PREFIXLEN is 0 (i.e. ::/0).
> 
> (It does not happen if PREFIXLEN is a multiple of 32.)
> Fix below.
> 
> commit f52d74a1a83c4fa30fcab8b318d325bb3c9b5535
> Author: Jan Engelhardt <jengelh@medozas.de>
> Date:   Tue Jun 10 14:05:21 2008 +0200
> 
> ip6tables: fix printing of ipv6 network masks
>     
> Signed-off-by: Jan Engelhardt <jengelh@medozas.de>

Applied, thanks. I guess I'll release a 1.4.1.1 during the next days.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-06-10 13:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-10 11:49 iptables-1.4.1: ip6tables -L prints network mask instead of prefix length Petr Pisar
2008-06-10 12:06 ` Jan Engelhardt
2008-06-10 13:01   ` Petr Pisar
2008-06-10 13:18   ` Patrick McHardy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.