ip6t_LOG.c: patch killing spaces on ouput of IPv4 address on TUNNEL=
Subsystems (3)
Hi,
I'm still wondering that this was never fixed since 3 years:
--- linux-2.6.11/net/ipv6/netfilter/ip6t_LOG.c.orig 2005-03-05
16:39:41.390675372 +0100
+++ linux-2.6.11/net/ipv6/netfilter/ip6t_LOG.c 2005-03-05 16:56:53.975208199 +0100
@@ -404,10 +404,10 @@
printk("TUNNEL=");
p = skb->mac.raw + 12;
for (i = 0; i < 4; i++,p++)
- printk("%3d%s", *p,
+ printk("%d%s", *p,
i == 3 ? "->" : ".");
for (i = 0; i < 4; i++,p++)
- printk("%3d%c", *p,
+ printk("%d%c", *p,
i == 3 ? ' ' : '.');
}
}This will fix the really not nice output like shown below and avoid simple parsers for becoming in trouble:
Mar 5 16:47:31 host kernel: FW6-default-DROP-extIN:
IN=sit1
OUT=
MAC=01:23:45:67:89:ab->01:23:45:47:89:ac
TUNNEL=123.123. 0.123-> 12.123. 6.123
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
SRC=fe80:0000:0000:0000:0000:0000:0123:4567 DST=ff3e:0012:3456:789a:0000:0000:0000:1234
LEN=72 TC=0 HOPLIMIT=1 FLOWLBL=0 PROTO=ICMPv6 TYPE=131 CODE=0
I've nowhere else in netfilter log lines such empty space in IPv4 addresses
See also:
<https://lists.netfilter.org/pipermail/netfilter-devel/2002-April/007366.html>
Here, at least trailing "0" were printed.
Peter
Signature · 3 lines
Dr. Peter Bieringer http://www.bieringer.de/pb/ GPG/PGP Key 0x958F422D mailto: pb at bieringer dot de Deep Space 6 Co-Founder and Core Member http://www.deepspace6.net/
net/ipv6/netfilter/ip6t_LOG.c renamed from net/ipv6/netfilter/ip6t_LOG.c.orig +2 -2
@@ -404,10 +404,10 @@printk ("TUNNEL=" ); p = skb->mac.raw +12 ;for (i =0 ; i <4 ; i++,p++) -printk ("%3d%s" , *p, +printk ("%d%s" , *p, i ==3 ?"->" :"." );for (i =0 ; i <4 ; i++,p++) -printk ("%3d%c" , *p, +printk ("%d%c" , *p, i ==3 ?' ' :'.' ); } }
Quoted 3 lines · Peter Bieringer
Hi,
I'm still wondering that this was never fixed since 3 years:
Because it presumably breaks existing scripts that expect it to be in the broken (speced) format.
I'm not particularly for or against that change... but whatever I do, somebody will always be complaining. To make you happy and have someone else complain next time ;)
Signature · 3 lines
- Harald Welte <[email protected]> http://www.gnumonks.org/ ============================================================================ Programming is like sex: One mistake and you have to support it your lifetime
--On Monday, March 14, 2005 09:06:28 AM +0100 Harald Welte
Quoted 7 lines · <[email protected]> wrote:
Quoted 3 lines · Peter Bieringer
Hi,
I'm still wondering that this was never fixed since 3 years:
Because it presumably breaks existing scripts that expect it to be in the broken (speced) format.
How many scripts are already parsing IPv6 log lines? Show me one, please. I believe I'm the only one who really looked into the logs because I saw nobody else ever claiming about the broken printout.
Quoted 3 lines
I'm not particularly for or against that change... but whatever I do, somebody will always be complaining. To make you happy and have someone else complain next time ;)
I don't believe that it is a good idea to let broken log output long time in the kernel, especially in IPv6 world, where changes still ongoing in current Linux kernel. How longer you wait the more will ran (perhaps) into temporary trouble.
For all the script writers, add a module option like "broken_log_lines=yes" ;-)
Regards,
Peter
Signature · 3 lines
Dr. Peter Bieringer http://www.bieringer.de/pb/ GPG/PGP Key 0x958F422D mailto: pb at bieringer dot de Deep Space 6 Co-Founder and Core Member http://www.deepspace6.net/
Quoted 2 lines
Signed-off-by Harald Welte <[email protected]>