netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch to latest iproute to get it to compile on FC5
@ 2008-02-13 19:32 Ben Greear
  2008-02-13 19:56 ` Stephen Hemminger
  2008-02-13 20:34 ` Stephen Hemminger
  0 siblings, 2 replies; 5+ messages in thread
From: Ben Greear @ 2008-02-13 19:32 UTC (permalink / raw)
  To: NetDev, Stephen Hemminger

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

I notice that the latest snapshot and git repository for iproute
will not compile on FC5 due to not finding __constant_hton* symbols
and a lack of the hdlc/ioctl.h file on FC5.

I am attaching a patch that appears to fix the problems for me.

Please consider applying this or something similar.

Signed-off-by:  Ben Greear <greearb@candelatech.com>


Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


[-- Attachment #2: iproute.fc5.patch --]
[-- Type: text/x-patch, Size: 2002 bytes --]

diff --git a/configure b/configure
index dc14e54..f28e4cf 100755
--- a/configure
+++ b/configure
@@ -25,3 +25,22 @@ else
     echo no
 fi
 rm -f /tmp/atmtest.c /tmp/atmtest
+
+echo -n "HDLC IOCTL:   "
+cat >/tmp/hdlctest.c <<EOF
+#include <net/if.h>
+#include <linux/hdlc/ioctl.h>
+int main(int argc, char **argv) {
+        return 0;
+}
+EOF
+gcc -I$INCLUDE -o /tmp/hdlctest /tmp/hdlctest.c >/dev/null 2>&1
+if [ $? -eq 0 ]
+then
+    echo "IPROUTE_CONFIG_HDLC:=y" >>Config
+    echo yes
+else
+    echo no
+fi
+rm -f /tmp/hdlctest.c /tmp/hdlctest
+
diff --git a/include/linux/if.h b/include/linux/if.h
index 40eb61f..9651cc9 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -23,7 +23,10 @@
 #include <linux/socket.h>		/* for "struct sockaddr" et al	*/
 
 #define	IFNAMSIZ	16
+
+#ifdef HAVE_HDLC_IOCTL
 #include <linux/hdlc/ioctl.h>
+#endif
 
 /* Standard interface flags (netdevice->flags). */
 #define	IFF_UP		0x1		/* interface is up		*/
@@ -133,6 +136,7 @@ struct if_settings
 {
 	unsigned int type;	/* Type of physical device or protocol */
 	unsigned int size;	/* Size of the data allocated by the caller */
+#ifdef HAVE_HDLC_IOCTL
 	union {
 		/* {atm/eth/dsl}_settings anyone ? */
 		raw_hdlc_proto	 *raw_hdlc;
@@ -145,6 +149,7 @@ struct if_settings
 		sync_serial_settings *sync;
 		te1_settings	 *te1;
 	} ifs_ifsu;
+#endif
 };
 
 /*
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index 228eb4e..0eb5b04 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -2,6 +2,7 @@
 #define _IF_TUNNEL_H_
 
 #include <linux/types.h>
+#include <asm/byteorder.h>
 
 #define SIOCGETTUNNEL   (SIOCDEVPRIVATE + 0)
 #define SIOCADDTUNNEL   (SIOCDEVPRIVATE + 1)
diff --git a/lib/Makefile b/lib/Makefile
index bc270bf..1c51a42 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -1,3 +1,9 @@
+include ../Config
+
+ifeq ($(IPROUTE_CONFIG_HDLC),y)
+   CFLAGS += -DHAVE_HDLC_IOCTL
+endif
+
 
 UTILOBJ=utils.o rt_names.o ll_types.o ll_proto.o ll_addr.o inet_proto.o
 

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

* Re: Patch to latest iproute to get it to compile on FC5
  2008-02-13 19:32 Patch to latest iproute to get it to compile on FC5 Ben Greear
@ 2008-02-13 19:56 ` Stephen Hemminger
  2008-02-13 20:34 ` Stephen Hemminger
  1 sibling, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2008-02-13 19:56 UTC (permalink / raw)
  To: Ben Greear; +Cc: NetDev

On Wed, 13 Feb 2008 11:32:32 -0800
Ben Greear <greearb@candelatech.com> wrote:

> I notice that the latest snapshot and git repository for iproute
> will not compile on FC5 due to not finding __constant_hton* symbols
> and a lack of the hdlc/ioctl.h file on FC5.
> 
> I am attaching a patch that appears to fix the problems for me.
> 
> Please consider applying this or something similar.
> 
> Signed-off-by:  Ben Greear <greearb@candelatech.com>
> 
> 
> Thanks,
> Ben
> 

No. please don't change the configure script.
And the linux/if.h comes from kernel stripped headers so it should
not get crufted up by ifdef's.

Short term fix is to include stripped hdlc header if needed.
Long fix is to get rid of hdlc dependency if possible.

-- 
Stephen Hemminger <stephen.hemminger@vyatta.com>

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

* Re: Patch to latest iproute to get it to compile on FC5
  2008-02-13 19:32 Patch to latest iproute to get it to compile on FC5 Ben Greear
  2008-02-13 19:56 ` Stephen Hemminger
@ 2008-02-13 20:34 ` Stephen Hemminger
  2008-02-13 20:52   ` Ben Greear
  2008-02-14  6:06   ` Ben Greear
  1 sibling, 2 replies; 5+ messages in thread
From: Stephen Hemminger @ 2008-02-13 20:34 UTC (permalink / raw)
  To: Ben Greear; +Cc: NetDev

On Wed, 13 Feb 2008 11:32:32 -0800
Ben Greear <greearb@candelatech.com> wrote:

> I notice that the latest snapshot and git repository for iproute
> will not compile on FC5 due to not finding __constant_hton* symbols
> and a lack of the hdlc/ioctl.h file on FC5.
> 
> I am attaching a patch that appears to fix the problems for me.
> 
> Please consider applying this or something similar.
> 
> Signed-off-by:  Ben Greear <greearb@candelatech.com>
> 
> 
> Thanks,
> Ben
> 

I added include/linux/hdlc/ioctl.h to the santized headers in the
current git.

-- 
Stephen Hemminger <stephen.hemminger@vyatta.com>

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

* Re: Patch to latest iproute to get it to compile on FC5
  2008-02-13 20:34 ` Stephen Hemminger
@ 2008-02-13 20:52   ` Ben Greear
  2008-02-14  6:06   ` Ben Greear
  1 sibling, 0 replies; 5+ messages in thread
From: Ben Greear @ 2008-02-13 20:52 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: NetDev

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

Stephen Hemminger wrote:
> On Wed, 13 Feb 2008 11:32:32 -0800
> Ben Greear <greearb@candelatech.com> wrote:
> 
>> I notice that the latest snapshot and git repository for iproute
>> will not compile on FC5 due to not finding __constant_hton* symbols
>> and a lack of the hdlc/ioctl.h file on FC5.
>>
>> I am attaching a patch that appears to fix the problems for me.
>>
>> Please consider applying this or something similar.
>>
>> Signed-off-by:  Ben Greear <greearb@candelatech.com>
>>
>>
>> Thanks,
>> Ben
>>
> 
> I added include/linux/hdlc/ioctl.h to the santized headers in the
> current git.
> 

That seems to fix the hdlc issue, but it still will not link due to missing
symbols:

gcc -Wl,-export-dynamic  ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o rtm_map.o iptunnel.o ip6tunnel.o tunnel.o ipneigh.o ipntable.o iplink.o ipmaddr.o ipmonitor.o ipmroute.o ipprefix.o ipxfrm.o xfrm_state.o xfrm_policy.o xfrm_monitor.o iplink_vlan.o link_veth.o ../lib/libnetlink.a ../lib/libutil.a  -lresolv -L../lib -lnetlink -lutil -ldl -o ip
iptunnel.o: In function `parse_args':
iptunnel.c:(.text+0x2c6): undefined reference to `__constant_htons'
iptunnel.c:(.text+0x404): undefined reference to `__constant_htons'
iptunnel.c:(.text+0x48d): undefined reference to `__constant_htons'
iptunnel.c:(.text+0x4a6): undefined reference to `__constant_htons'
iptunnel.c:(.text+0x4e2): undefined reference to `__constant_htons'
iptunnel.o:iptunnel.c:(.text+0x4fb): more undefined references to `__constant_htons' follow
collect2: ld returned 1 exit status
make[1]: *** [ip] Error 1
make[1]: Leaving directory `/root/iproute2/ip'
make: *** [all] Error 2


The attached patch fixes this.

Thanks,
Ben


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


[-- Attachment #2: iproute.fc5.patch --]
[-- Type: text/x-patch, Size: 350 bytes --]

diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index 228eb4e..0eb5b04 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -2,6 +2,7 @@
 #define _IF_TUNNEL_H_
 
 #include <linux/types.h>
+#include <asm/byteorder.h>
 
 #define SIOCGETTUNNEL   (SIOCDEVPRIVATE + 0)
 #define SIOCADDTUNNEL   (SIOCDEVPRIVATE + 1)

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

* Re: Patch to latest iproute to get it to compile on FC5
  2008-02-13 20:34 ` Stephen Hemminger
  2008-02-13 20:52   ` Ben Greear
@ 2008-02-14  6:06   ` Ben Greear
  1 sibling, 0 replies; 5+ messages in thread
From: Ben Greear @ 2008-02-14  6:06 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: NetDev

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

Here's another try at the patch to make the __constant_htonl methods
be included, but without changing any of the .h files.  I tested this on
an FC2 system, and it compiles fine.

Interesting to me, it seems you are not supposed to #include 
<asm/byteorder.h> directly,
but when I tried the suggested <endian.h>, it didn't actually fix the 
problem.

Signed-off-by:  Ben Greear <greearb@candelatech.com>

-- 
Ben Greear <greearb@candelatech.com> 
Candela Technologies Inc  http://www.candelatech.com



[-- Attachment #2: iproute.patch --]
[-- Type: text/x-patch, Size: 285 bytes --]

diff --git a/ip/iptunnel.c b/ip/iptunnel.c
index 3b466bf..2b2b78e 100644
--- a/ip/iptunnel.c
+++ b/ip/iptunnel.c
@@ -34,6 +34,7 @@
 #include "ip_common.h"
 #include "tunnel.h"
 
+#include <asm/byteorder.h>
 static void usage(void) __attribute__((noreturn));
 
 static void usage(void)

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

end of thread, other threads:[~2008-02-14  6:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-13 19:32 Patch to latest iproute to get it to compile on FC5 Ben Greear
2008-02-13 19:56 ` Stephen Hemminger
2008-02-13 20:34 ` Stephen Hemminger
2008-02-13 20:52   ` Ben Greear
2008-02-14  6:06   ` Ben Greear

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).