From ff2b6d21853ca6417a43c06f37a32201f881245d Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Fri, 23 Nov 2007 03:39:45 +0000 Subject: logread: eliminate usage of data/bss ifup: don't remove virtual iface prefixes (eth0:0) function old new delta shbuf 4 - -4 SMrup 6 - -6 SMrdn 12 - -12 static.label_buf 20 4 -16 get_var 158 140 -18 ------------------------------------------------------------------------------ (add/remove: 0/3 grow/shrink: 0/2 up/down: 0/-56) Total: -56 bytes text data bss dec hex filename 783501 962 9260 793723 c1c7b busybox_old 783483 942 9244 793669 c1c45 busybox_unstripped --- networking/ifupdown.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'networking/ifupdown.c') diff --git a/networking/ifupdown.c b/networking/ifupdown.c index c4d7252..31911cd 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c @@ -134,13 +134,15 @@ static char *get_var(const char *id, size_t idlen, struct interface_defn_t *ifd) int i; if (strncmpz(id, "iface", idlen) == 0) { - char *result; - static char label_buf[20]; - safe_strncpy(label_buf, ifd->iface, sizeof(label_buf)); - result = strchr(label_buf, ':'); - if (result) { - *result = '\0'; - } + static char *label_buf; + //char *result; + + free(label_buf); + label_buf = xstrdup(ifd->iface); + // Remove virtual iface suffix - why? + // ubuntu's ifup doesn't do this + //result = strchrnul(label_buf, ':'); + //*result = '\0'; return label_buf; } if (strncmpz(id, "label", idlen) == 0) { -- cgit v1.1