From 01eaee9309c09ca5d7dc6ef3b2e96084affdab30 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Mon, 21 Apr 2008 02:21:45 +0000 Subject: *: 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 --- networking/nameif.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'networking/nameif.c') 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 @@ #include #include -/* Older versions of net/if.h do not appear to define IF_NAMESIZE. */ -#ifndef IF_NAMESIZE -# ifdef IFNAMSIZ -# define IF_NAMESIZE IFNAMSIZ -# else -# define IF_NAMESIZE 16 -# endif +#ifndef IFNAMSIZ +#define IFNAMSIZ 16 #endif -/* take from linux/sockios.h */ +/* Taken from linux/sockios.h */ #define SIOCSIFNAME 0x8923 /* set interface name */ /* Octets in one Ethernet addr, from */ @@ -111,7 +106,7 @@ static void nameif_parse_selector(ethtable_t *ch, char *selector) static void prepend_new_eth_table(ethtable_t **clist, char *ifname, char *selector) { ethtable_t *ch; - if (strlen(ifname) >= IF_NAMESIZE) + if (strlen(ifname) >= IFNAMSIZ) bb_error_msg_and_die("interface name '%s' too long", ifname); ch = xzalloc(sizeof(*ch)); ch->ifname = xstrdup(ifname); -- cgit v1.2.3