All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] --log-ip-options broken in 2.4
@ 2005-01-29  7:04 Michael Rash
  2005-03-04 10:39 ` Patrick McHardy
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Rash @ 2005-01-29  7:04 UTC (permalink / raw)
  To: netfilter-devel

[-- Attachment #1: Type: text/plain, Size: 549 bytes --]

It looks like --log-ip-options is broken in 2.4, i.e. the OPT field
never appears in Netfilter logs even when packets contain IP options.
I have attached a small patch that fixes this.  It removes the
"iph->ihl * 4 >= datalen" condition, which rarely happens ("ping -T
tsonly -s 1 <host>" will trigger it for example).  The resulting code is
analogous to the code in the 2.6 kernel.

This is for Netfilter bugzilla # 288.

Thanks,

--Mike

Michael Rash
http://www.cipherdyne.org/
Key fingerprint = 53EA 13EA 472E 3771 894F  AC69 95D8 5D6B A742 839F

[-- Attachment #2: ipt_LOG.c_ipoptions.patch --]
[-- Type: text/plain, Size: 555 bytes --]

--- linux-2.4.29.orig/net/ipv4/netfilter/ipt_LOG.c      2005-01-29 01:55:29.000000000 -0500
+++ linux-2.4.29/net/ipv4/netfilter/ipt_LOG.c   2005-01-29 01:50:36.000000000 -0500
@@ -67,8 +67,7 @@
                printk("FRAG:%u ", ntohs(iph->frag_off) & IP_OFFSET);

        if ((info->logflags & IPT_LOG_IPOPT)
-           && iph->ihl * 4 != sizeof(struct iphdr)
-           && iph->ihl * 4 >= datalen) {
+           && iph->ihl * 4 > sizeof(struct iphdr)) {
                unsigned int i;

                /* Max length: 127 "OPT (" 15*4*2chars ") " */


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

end of thread, other threads:[~2005-03-04 10:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-29  7:04 [PATCH] --log-ip-options broken in 2.4 Michael Rash
2005-03-04 10:39 ` 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.