All of lore.kernel.org
 help / color / mirror / Atom feed
* iptables-1.4.2: libxt_TOS.c compilation ending with error - IPPROTO_SCTP redefined
@ 2008-10-21 22:01 Jiří Moravec
  2008-10-22  6:59 ` Patrick McHardy
  0 siblings, 1 reply; 2+ messages in thread
From: Jiří Moravec @ 2008-10-21 22:01 UTC (permalink / raw)
  To: netfilter-devel

When I compiled iptables-1.4.2 I get an error:

In file included from /usr/include/netinet/ip.h:25,
                 from /usr/include/linux/ip.h:19,
                 from tos_values.c:4,
                 from libxt_TOS.c:15:
/usr/include/netinet/in.h:84: error: expected identifier before numeric constant
make[2]: *** [libxt_TOS.oo] Error 1



libxt_TOS.c:12
#include <xtables.h>
#include <linux/netfilter/xt_DSCP.h>
#include <linux/netfilter_ipv4/ipt_TOS.h>
#include "tos_values.c"

/usr/include/xtables.h:10
#ifndef IPPROTO_SCTP
#define IPPROTO_SCTP 132
#endif

/usr/include/netinet/in.h:84 (through tos_values.c -> linux/ip.h -> netinet/ip.h)
    IPPROTO_SCTP = 132,	   /* Stream Control Transmission Protocol.  */
#define IPPROTO_SCTP		IPPROTO_SCTP


On my gentoo box IPPROTO_SCTP is defined in /usr/include/netinet/in.h (from sys-libs/glibc-2.7 package)
and in /usr/include/xtables.h (net-firewall/iptables-1.4.1.1 package) too (conditionally).

However, in libxt_TOS.c <xtables.h> preceded <netinet/in.h> and SCTP is already defined by <xtables.h>.
So, definition in <netinet/in.h> ending with error, because line "IPPROTO_SCTP = 132", 
is probably interpreted as "132 = 132"


As a temporary workaround, I included <netinet/in.h> before <xtables.h>:
--- iptables-1.4.2/extensions/libxt_TOS.c.old   2008-10-21 20:06:18.334809888 +0200
+++ iptables-1.4.2/extensions/libxt_TOS.c       2008-10-21 20:06:47.774810167 +0200
@@ -9,6 +9,7 @@
 #include <stdlib.h>
 #include <string.h>

+#include <netinet/in.h>
 #include <xtables.h>
 #include <linux/netfilter/xt_DSCP.h>
 #include <linux/netfilter_ipv4/ipt_TOS.h>
---

JiM

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

* Re: iptables-1.4.2: libxt_TOS.c compilation ending with error - IPPROTO_SCTP redefined
  2008-10-21 22:01 iptables-1.4.2: libxt_TOS.c compilation ending with error - IPPROTO_SCTP redefined Jiří Moravec
@ 2008-10-22  6:59 ` Patrick McHardy
  0 siblings, 0 replies; 2+ messages in thread
From: Patrick McHardy @ 2008-10-22  6:59 UTC (permalink / raw)
  To: Jiří Moravec; +Cc: netfilter-devel

Jiří Moravec wrote:
> When I compiled iptables-1.4.2 I get an error:
> 
> In file included from /usr/include/netinet/ip.h:25,
>                  from /usr/include/linux/ip.h:19,
>                  from tos_values.c:4,
>                  from libxt_TOS.c:15:
> /usr/include/netinet/in.h:84: error: expected identifier before numeric constant
> make[2]: *** [libxt_TOS.oo] Error 1
> 
> 
> 
> libxt_TOS.c:12
> #include <xtables.h>
> #include <linux/netfilter/xt_DSCP.h>
> #include <linux/netfilter_ipv4/ipt_TOS.h>
> #include "tos_values.c"
> 
> /usr/include/xtables.h:10
> #ifndef IPPROTO_SCTP
> #define IPPROTO_SCTP 132
> #endif
> 
> /usr/include/netinet/in.h:84 (through tos_values.c -> linux/ip.h -> netinet/ip.h)
>     IPPROTO_SCTP = 132,	   /* Stream Control Transmission Protocol.  */
> #define IPPROTO_SCTP		IPPROTO_SCTP
> 
> 
> On my gentoo box IPPROTO_SCTP is defined in /usr/include/netinet/in.h (from sys-libs/glibc-2.7 package)
> and in /usr/include/xtables.h (net-firewall/iptables-1.4.1.1 package) too (conditionally).
> 
> However, in libxt_TOS.c <xtables.h> preceded <netinet/in.h> and SCTP is already defined by <xtables.h>.
> So, definition in <netinet/in.h> ending with error, because line "IPPROTO_SCTP = 132", 
> is probably interpreted as "132 = 132"
> 
> 
> As a temporary workaround, I included <netinet/in.h> before <xtables.h>:

I don't have a better solution, so I've applied your patch. Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2008-10-22  6:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-21 22:01 iptables-1.4.2: libxt_TOS.c compilation ending with error - IPPROTO_SCTP redefined Jiří Moravec
2008-10-22  6:59 ` 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.