diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-04-21 02:21:45 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-04-21 02:21:45 +0000 |
commit | 01eaee9309c09ca5d7dc6ef3b2e96084affdab30 (patch) | |
tree | 4679b85ef024d357f3e3ada864555a63172a050d /networking/nameif.c | |
parent | 0a1446275d88946734417ed96a3c0f1d7ea969e4 (diff) | |
download | busybox-w32-01eaee9309c09ca5d7dc6ef3b2e96084affdab30.tar.gz busybox-w32-01eaee9309c09ca5d7dc6ef3b2e96084affdab30.tar.bz2 busybox-w32-01eaee9309c09ca5d7dc6ef3b2e96084affdab30.zip |
*: s/IF_NAMESIZE/IFNAMSIZ/, regularize its use a bit.
function old new delta
strncpy_IFNAMSIZ - 13 +13
set_slave_mtu 39 37 -2
set_slave_hwaddr 52 50 -2
set_master_hwaddr 52 50 -2
set_if_flags 40 38 -2
get_if_settings 101 98 -3
ifenslave_main 1680 1661 -19
vconfig_main 306 280 -26
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/7 up/down: 13/-56) Total: -43 bytes
Diffstat (limited to 'networking/nameif.c')
-rw-r--r-- | networking/nameif.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/networking/nameif.c b/networking/nameif.c index afc88917e..f3d333baf 100644 --- a/networking/nameif.c +++ b/networking/nameif.c | |||
@@ -16,16 +16,11 @@ | |||
16 | #include <netinet/ether.h> | 16 | #include <netinet/ether.h> |
17 | #include <linux/sockios.h> | 17 | #include <linux/sockios.h> |
18 | 18 | ||
19 | /* Older versions of net/if.h do not appear to define IF_NAMESIZE. */ | 19 | #ifndef IFNAMSIZ |
20 | #ifndef IF_NAMESIZE | 20 | #define IFNAMSIZ 16 |
21 | # ifdef IFNAMSIZ | ||
22 | # define IF_NAMESIZE IFNAMSIZ | ||
23 | # else | ||
24 | # define IF_NAMESIZE 16 | ||
25 | # endif | ||
26 | #endif | 21 | #endif |
27 | 22 | ||
28 | /* take from linux/sockios.h */ | 23 | /* Taken from linux/sockios.h */ |
29 | #define SIOCSIFNAME 0x8923 /* set interface name */ | 24 | #define SIOCSIFNAME 0x8923 /* set interface name */ |
30 | 25 | ||
31 | /* Octets in one Ethernet addr, from <linux/if_ether.h> */ | 26 | /* Octets in one Ethernet addr, from <linux/if_ether.h> */ |
@@ -111,7 +106,7 @@ static void nameif_parse_selector(ethtable_t *ch, char *selector) | |||
111 | static void prepend_new_eth_table(ethtable_t **clist, char *ifname, char *selector) | 106 | static void prepend_new_eth_table(ethtable_t **clist, char *ifname, char *selector) |
112 | { | 107 | { |
113 | ethtable_t *ch; | 108 | ethtable_t *ch; |
114 | if (strlen(ifname) >= IF_NAMESIZE) | 109 | if (strlen(ifname) >= IFNAMSIZ) |
115 | bb_error_msg_and_die("interface name '%s' too long", ifname); | 110 | bb_error_msg_and_die("interface name '%s' too long", ifname); |
116 | ch = xzalloc(sizeof(*ch)); | 111 | ch = xzalloc(sizeof(*ch)); |
117 | ch->ifname = xstrdup(ifname); | 112 | ch->ifname = xstrdup(ifname); |