ipt_osf: fix ipt_osf compilation on some distros.
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
Quoted 3 lines · Evgeniy Polyakov
Some distros have magical header mess, which leads to undefined struct tcphdr, when
net/tcp.his 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
Signed-off-by Evgeniy Polyakov <[email protected]>--- 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.c2005-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 inipt_osf.hinto appropriate ifdef/endif?
Yes, please.
Regards
Patrick
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
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,
whennet/tcp.his not included directly.
Following patch workarounds it.You should include
linux/tcp.hfor struct tcphdr. You probably also don't need the othernet/includes, for struct iphdr uselinux/ip.h,sock.hshouldn'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 inipt_osf.hinto 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
PATCH 1/2 ipt_osf: move kernel headers into appropriate ifdef/endif area.
In reply to Patrick McHardyMove 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
PATCH 2/2 ipt_osf: includes cleanup.
In reply to Patrick McHardyIncludes 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
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
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