aboutsummaryrefslogtreecommitdiff
path: root/networking/ifconfig.c
diff options
context:
space:
mode:
authorBartosz Golaszewski <bartekgola@gmail.com>2013-07-25 04:39:04 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2013-07-25 04:39:04 +0200
commitc19be75d57ff42dee54b53e21b3eb4723b8cf243 (patch)
tree7fc65e75d2c91ee1021e327aaa4e1ba0e81ccb15 /networking/ifconfig.c
parentb855460adcda8dfb18ac36755f128ce32088ae87 (diff)
downloadbusybox-w32-c19be75d57ff42dee54b53e21b3eb4723b8cf243.tar.gz
busybox-w32-c19be75d57ff42dee54b53e21b3eb4723b8cf243.tar.bz2
busybox-w32-c19be75d57ff42dee54b53e21b3eb4723b8cf243.zip
networking: code shrink
function old new delta in_ether - 124 +124 hexchar2int 42 - -42 ifconfig_main 1237 1106 -131 ether_input 141 - -141 ------------------------------------------------------------------------------ (add/remove: 2/2 grow/shrink: 0/1 up/down: 124/-314) Total: -190 bytes Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/ifconfig.c')
-rw-r--r--networking/ifconfig.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/networking/ifconfig.c b/networking/ifconfig.c
index 782374b35..999305aff 100644
--- a/networking/ifconfig.c
+++ b/networking/ifconfig.c
@@ -265,49 +265,6 @@ static const struct options OptArray[] = {
265 { NULL, 0, ARG_HOSTNAME, (IFF_UP | IFF_RUNNING) } 265 { NULL, 0, ARG_HOSTNAME, (IFF_UP | IFF_RUNNING) }
266}; 266};
267 267
268#if ENABLE_FEATURE_IFCONFIG_HW
269/* Input an Ethernet address and convert to binary. */
270static int in_ether(const char *bufp, struct sockaddr *sap)
271{
272 char *ptr;
273 int i, j;
274 unsigned char val;
275 unsigned char c;
276
277 sap->sa_family = ARPHRD_ETHER;
278 ptr = (char *) sap->sa_data;
279
280 i = 0;
281 do {
282 j = val = 0;
283
284 /* We might get a semicolon here - not required. */
285 if (i && (*bufp == ':')) {
286 bufp++;
287 }
288
289 do {
290 c = *bufp;
291 if (((unsigned char)(c - '0')) <= 9) {
292 c -= '0';
293 } else if ((unsigned char)((c|0x20) - 'a') <= 5) {
294 c = (unsigned char)((c|0x20) - 'a') + 10;
295 } else if (j && (c == ':' || c == 0)) {
296 break;
297 } else {
298 return -1;
299 }
300 ++bufp;
301 val <<= 4;
302 val += c;
303 } while (++j < 2);
304 *ptr++ = val;
305 } while (++i < ETH_ALEN);
306
307 return *bufp; /* Error if we don't end at end of string. */
308}
309#endif
310
311int ifconfig_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 268int ifconfig_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
312int ifconfig_main(int argc UNUSED_PARAM, char **argv) 269int ifconfig_main(int argc UNUSED_PARAM, char **argv)
313{ 270{