diff options
author | Eric Andersen <andersen@codepoet.org> | 2003-06-20 09:05:00 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2003-06-20 09:05:00 +0000 |
commit | 0f08e53535a7a1c0d4f7699f2e4224a255921559 (patch) | |
tree | ceebbc8c3fd94050aaf8a775807a49ae25286981 /networking/libiproute | |
parent | 8876fb2f59a0b515b3121d5894933eef88ce566a (diff) | |
download | busybox-w32-0f08e53535a7a1c0d4f7699f2e4224a255921559.tar.gz busybox-w32-0f08e53535a7a1c0d4f7699f2e4224a255921559.tar.bz2 busybox-w32-0f08e53535a7a1c0d4f7699f2e4224a255921559.zip |
Patch from Lars Kellogg-Stedman:
I'm building BusyBox using a development kit for MontaVista Hardhat Linux
(PPC) -- which, at least in this instance, is based around kernel 2.2.14.
I've had to massage a few files in networking/libiproute/ to make it
compile. Specifically:
(1) Added a #include <sys/uio.h> for the iovec structure in
libnetlink.c,
(2) Put ifdefs in ll_types.c and ll_proto.c around various
constants (ETH_P_xxx and ARPHRD_xxx) that weren't defined,
(3) Make do_changename() in iplink.c require a kernel >=
2.4.0 -- the ifr structure in my environment doesn't
have the ifr_name attribute. I've assumed this is
a kernel dependency -- let me know if I ought to be
checking something else.
In the absence of the correct kernel, do_changename()
always returns 0.
Attached is a patch against the current CVS that will make these changes.
-- Lars
Diffstat (limited to 'networking/libiproute')
-rw-r--r-- | networking/libiproute/iplink.c | 4 | ||||
-rw-r--r-- | networking/libiproute/libnetlink.c | 2 | ||||
-rw-r--r-- | networking/libiproute/ll_proto.c | 10 | ||||
-rw-r--r-- | networking/libiproute/ll_types.c | 6 |
4 files changed, 22 insertions, 0 deletions
diff --git a/networking/libiproute/iplink.c b/networking/libiproute/iplink.c index f826ba081..daab6938d 100644 --- a/networking/libiproute/iplink.c +++ b/networking/libiproute/iplink.c | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #include <sys/ioctl.h> | 13 | #include <sys/ioctl.h> |
14 | #include <sys/socket.h> | 14 | #include <sys/socket.h> |
15 | #include <linux/version.h> | ||
15 | 16 | ||
16 | #include <errno.h> | 17 | #include <errno.h> |
17 | #include <stdlib.h> | 18 | #include <stdlib.h> |
@@ -95,6 +96,7 @@ static int do_chflags(char *dev, __u32 flags, __u32 mask) | |||
95 | 96 | ||
96 | static int do_changename(char *dev, char *newdev) | 97 | static int do_changename(char *dev, char *newdev) |
97 | { | 98 | { |
99 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) | ||
98 | struct ifreq ifr; | 100 | struct ifreq ifr; |
99 | int fd; | 101 | int fd; |
100 | int err; | 102 | int err; |
@@ -112,6 +114,8 @@ static int do_changename(char *dev, char *newdev) | |||
112 | } | 114 | } |
113 | close(fd); | 115 | close(fd); |
114 | return err; | 116 | return err; |
117 | #endif | ||
118 | return 0; | ||
115 | } | 119 | } |
116 | 120 | ||
117 | static int set_qlen(char *dev, int qlen) | 121 | static int set_qlen(char *dev, int qlen) |
diff --git a/networking/libiproute/libnetlink.c b/networking/libiproute/libnetlink.c index 04411931d..9390e56fb 100644 --- a/networking/libiproute/libnetlink.c +++ b/networking/libiproute/libnetlink.c | |||
@@ -18,6 +18,8 @@ | |||
18 | #include <time.h> | 18 | #include <time.h> |
19 | #include <unistd.h> | 19 | #include <unistd.h> |
20 | 20 | ||
21 | #include <sys/uio.h> | ||
22 | |||
21 | #include "libnetlink.h" | 23 | #include "libnetlink.h" |
22 | #include "libbb.h" | 24 | #include "libbb.h" |
23 | 25 | ||
diff --git a/networking/libiproute/ll_proto.c b/networking/libiproute/ll_proto.c index d7b1dedfc..cfdb34e38 100644 --- a/networking/libiproute/ll_proto.c +++ b/networking/libiproute/ll_proto.c | |||
@@ -51,10 +51,18 @@ __PF(ATALK,atalk) | |||
51 | __PF(AARP,aarp) | 51 | __PF(AARP,aarp) |
52 | __PF(IPX,ipx) | 52 | __PF(IPX,ipx) |
53 | __PF(IPV6,ipv6) | 53 | __PF(IPV6,ipv6) |
54 | #ifdef ETH_P_PPP_DISC | ||
54 | __PF(PPP_DISC,ppp_disc) | 55 | __PF(PPP_DISC,ppp_disc) |
56 | #endif | ||
57 | #ifdef ETH_P_PPP_SES | ||
55 | __PF(PPP_SES,ppp_ses) | 58 | __PF(PPP_SES,ppp_ses) |
59 | #endif | ||
60 | #ifdef ETH_P_ATMMPOA | ||
56 | __PF(ATMMPOA,atmmpoa) | 61 | __PF(ATMMPOA,atmmpoa) |
62 | #endif | ||
63 | #ifdef ETH_P_ATMFATE | ||
57 | __PF(ATMFATE,atmfate) | 64 | __PF(ATMFATE,atmfate) |
65 | #endif | ||
58 | 66 | ||
59 | __PF(802_3,802_3) | 67 | __PF(802_3,802_3) |
60 | __PF(AX25,ax25) | 68 | __PF(AX25,ax25) |
@@ -70,7 +78,9 @@ __PF(TR_802_2,tr_802_2) | |||
70 | __PF(MOBITEX,mobitex) | 78 | __PF(MOBITEX,mobitex) |
71 | __PF(CONTROL,control) | 79 | __PF(CONTROL,control) |
72 | __PF(IRDA,irda) | 80 | __PF(IRDA,irda) |
81 | #ifdef ETH_P_ECONET | ||
73 | __PF(ECONET,econet) | 82 | __PF(ECONET,econet) |
83 | #endif | ||
74 | 84 | ||
75 | { 0x8100, "802.1Q" }, | 85 | { 0x8100, "802.1Q" }, |
76 | { ETH_P_IP, "ipv4" }, | 86 | { ETH_P_IP, "ipv4" }, |
diff --git a/networking/libiproute/ll_types.c b/networking/libiproute/ll_types.c index 925d60ddc..f39f777e1 100644 --- a/networking/libiproute/ll_types.c +++ b/networking/libiproute/ll_types.c | |||
@@ -34,7 +34,9 @@ __PF(IEEE802,tr) | |||
34 | __PF(ARCNET,arcnet) | 34 | __PF(ARCNET,arcnet) |
35 | __PF(APPLETLK,atalk) | 35 | __PF(APPLETLK,atalk) |
36 | __PF(DLCI,dlci) | 36 | __PF(DLCI,dlci) |
37 | #ifdef ARPHRD_ATM | ||
37 | __PF(ATM,atm) | 38 | __PF(ATM,atm) |
39 | #endif | ||
38 | __PF(METRICOM,metricom) | 40 | __PF(METRICOM,metricom) |
39 | #ifdef ARPHRD_IEEE1394 | 41 | #ifdef ARPHRD_IEEE1394 |
40 | __PF(IEEE1394,ieee1394) | 42 | __PF(IEEE1394,ieee1394) |
@@ -48,12 +50,16 @@ __PF(RSRVD,rsrvd) | |||
48 | __PF(ADAPT,adapt) | 50 | __PF(ADAPT,adapt) |
49 | __PF(ROSE,rose) | 51 | __PF(ROSE,rose) |
50 | __PF(X25,x25) | 52 | __PF(X25,x25) |
53 | #ifdef ARPHRD_HWX25 | ||
51 | __PF(HWX25,hwx25) | 54 | __PF(HWX25,hwx25) |
55 | #endif | ||
52 | __PF(PPP,ppp) | 56 | __PF(PPP,ppp) |
53 | __PF(HDLC,hdlc) | 57 | __PF(HDLC,hdlc) |
54 | __PF(LAPB,lapb) | 58 | __PF(LAPB,lapb) |
59 | #ifdef ARPHRD_DDCMP | ||
55 | __PF(DDCMP,ddcmp) | 60 | __PF(DDCMP,ddcmp) |
56 | __PF(RAWHDLC,rawhdlc) | 61 | __PF(RAWHDLC,rawhdlc) |
62 | #endif | ||
57 | 63 | ||
58 | __PF(TUNNEL,ipip) | 64 | __PF(TUNNEL,ipip) |
59 | __PF(TUNNEL6,tunnel6) | 65 | __PF(TUNNEL6,tunnel6) |