Skip to contentSkip to conversation

ipt_osf: fix ipt_osf compilation on some distros.

PATCH In review Evgeniy Polyakov 2 participants 8 messages Feb 25, 2005 – Mar 1, 2005 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipt_osf: fix ipt_osf compilation on some distros.

Some distros have magical header mess, which leads to undefined struct tcphdr,
when net/tcp.h is not included directly.
Following patch workarounds it.

--- orig/osf/linux-2.6/net/ipv4/netfilter/ipt_osf.c~ 2005-02-07 18:55:56.000000000 +0300 +++orig/osf/linux-2.6/net/ipv4/netfilter/ipt_osf.c 2005-02-24 12:49:22.329311368 +0300
@@ -47,6 +47,7 @@

#include <net/sock.h>
#include <net/ip.h>
+#include <net/tcp.h>

#include <linux/netfilter_ipv4/ip_tables.h>

P.S. Should I resend lost patch with Subject line
"[1/1] libipt_osf: fix iptables-1.3.0rc1 compilation.", which moves kernel headers in ipt_osf.h into appropriate ifdef/endif?

Signature · 3 lines
        Evgeniy Polyakov

Crash is better than data corruption -- Arthur Grabowski
#1 lore raw
Quoted 3 lines · Evgeniy Polyakov

Some distros have magical header mess, which leads to undefined struct tcphdr, when net/tcp.h is not included directly.
Following patch workarounds it.

You should include linux/tcp.h for struct tcphdr. You probably also don't need the other net/ includes, for struct iphdr use linux/ip.h, sock.h shouldn't be needed at all.

Quoted 15 lines

--- orig/osf/linux-2.6/net/ipv4/netfilter/ipt_osf.c~ 2005-02-07 18:55:56.000000000 +0300 +++orig/osf/linux-2.6/net/ipv4/netfilter/ipt_osf.c 2005-02-24 12:49:22.329311368 +0300

(quoted diff) +1 -0
@@ -47,6 +47,7 @@
 
 #include <net/sock.h>
 #include <net/ip.h>
+#include <net/tcp.h>
 
 #include <linux/netfilter_ipv4/ip_tables.h>
 
Quoted 2 lines

P.S. Should I resend lost patch with Subject line "[1/1] libipt_osf: fix iptables-1.3.0rc1 compilation.", which moves kernel headers in ipt_osf.h into appropriate ifdef/endif?

Yes, please.

Regards
Patrick

#2 lore raw
Quoted 9 lines · On Sun, 27 Feb 2005 17:32:09 +0100 Patrick McHardy <[email protected]> wrote:
Quoted 4 lines · Evgeniy Polyakov

Some distros have magical header mess, which leads to undefined struct tcphdr,
when net/tcp.h is not included directly.
Following patch workarounds it.

You should include linux/tcp.h for struct tcphdr. You probably also don't need the other net/ includes, for struct iphdr use linux/ip.h, sock.h shouldn't be needed at all.

net/ip.h is needed due to IP_DF bit.
linux/sock.h is not needed but instead ipt_osf.c requires inetdevice.h due to in_dev_get() usage.

Quoted 6 lines
Quoted 4 lines

P.S. Should I resend lost patch with Subject line
"[1/1] libipt_osf: fix iptables-1.3.0rc1 compilation.", which moves kernel headers in ipt_osf.h into appropriate ifdef/endif?

Yes, please.

Both patches will be sent in 2 next e-mails.

Quoted 2 lines

Regards
Patrick

Evgeniy Polyakov

Only failure makes us experts. -- Theo de Raadt

#3 lore raw
Quoted 1 line · Evgeniy Polyakov

Both patches will be sent in 2 next e-mails.

Thanks. I'm having trouble accessing svn, I'll commit them when it is working again.

Regards
Patrick

#4 lore raw
Quoted 5 lines · On Sun, 27 Feb 2005 18:03:02 +0100 Patrick McHardy <[email protected]> wrote:
Quoted 1 line · Evgeniy Polyakov

Both patches will be sent in 2 next e-mails.

Thanks. I'm having trouble accessing svn, I'll commit them when it is working again.

Thank you.
Please inform me, so I could commit it into my trees.

Quoted 2 lines

Regards
Patrick

Evgeniy Polyakov

Only failure makes us experts. -- Theo de Raadt

#5 lore raw
Quoted 7 lines · Evgeniy Polyakov
Quoted 3 lines · On Sun, 27 Feb 2005 18:03:02 +0100 Patrick McHardy <[email protected]> wrote:

Thanks. I'm having trouble accessing svn, I'll commit them when it is working again.

Please inform me, so I could commit it into my trees.

I've applied both patches to trunk and the 2.6.11 branch.

Regards
Patrick

#6 lore raw

PATCH 1/2 ipt_osf: move kernel headers into appropriate ifdef/endif area.

In reply to Patrick McHardy

Move kernel headers into appropriate ifdef/endif area.

osf/linux-2.6/include/linux/netfilter_ipv4/ipt_osf.h 2005-02-07 19:11:43.854209776 +0300 renamed from osf/linux-2.6/include/linux/netfilter_ipv4/ipt_osf.h 2005-02-07 19:11:08.237624320+0300 +4 -3
@@ -33,9 +33,6 @@
 #define IPT_OSF_LOGLEVEL_ALL   0
 #define IPT_OSF_LOGLEVEL_FIRST 1
 
-#include <linux/list.h>
-#include <net/tcp.h>
-
 #ifndef __KERNEL__
 #include <netinet/ip.h>
 #include <netinet/tcp.h>
@@ -98,6 +95,10 @@
 
 #ifdef __KERNEL__
 
+#include <linux/list.h>
+#include <net/tcp.h>
+
+
 /* Defines for IANA option kinds */
 
 #define OSFOPT_EOL             0       /* End of options */

Evgeniy Polyakov

Only failure makes us experts. -- Theo de Raadt

#7 lore raw

PATCH 2/2 ipt_osf: includes cleanup.

In reply to Patrick McHardy

Includes cleanup.
ipt_osf requires inetdevice.h and tcp.h.

osf/linux-2.6/net/ipv4/netfilter/ipt_osf.c +2 -2
@@ -44,9 +44,9 @@
 #include <linux/ctype.h>
 #include <linux/list.h>
 #include <linux/if.h>
-
-#include <net/sock.h>
+#include <linux/inetdevice.h>
 #include <net/ip.h>
+#include <linux/tcp.h>
 
 #include <linux/netfilter_ipv4/ip_tables.h>
 

Evgeniy Polyakov

Only failure makes us experts. -- Theo de Raadt