--- trunk/mkinitrd-magellan/busybox/networking/libiproute/ll_proto.c 2010/04/29 20:38:48 983 +++ trunk/mkinitrd-magellan/busybox/networking/libiproute/ll_proto.c 2010/05/30 11:32:42 984 @@ -98,7 +98,7 @@ #undef __PF -const char *ll_proto_n2a(unsigned short id, char *buf, int len) +const char* FAST_FUNC ll_proto_n2a(unsigned short id, char *buf, int len) { unsigned i; id = ntohs(id); @@ -110,18 +110,20 @@ return buf; } -int ll_proto_a2n(unsigned short *id, char *buf) +int FAST_FUNC ll_proto_a2n(unsigned short *id, char *buf) { unsigned i; for (i = 0; i < ARRAY_SIZE(llproto_names); i++) { if (strcasecmp(llproto_names[i].name, buf) == 0) { - *id = htons(llproto_names[i].id); - return 0; + i = llproto_names[i].id; + goto good; } } - if (get_u16(id, buf, 0)) + i = bb_strtou(buf, NULL, 0); + if (errno || i > 0xffff) return -1; - *id = htons(*id); + good: + *id = htons(i); return 0; }