Changeset 1770 in MondoRescue for branches/stable/mindi-busybox/networking/libiproute/ll_proto.c
- Timestamp:
- Nov 6, 2007, 11:01:53 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi-busybox/networking/libiproute/ll_proto.c
r821 r1770 1 /* vi: set sw=4 ts=4: */ 1 2 /* 2 3 * ll_proto.c … … 11 12 12 13 #include "libbb.h" 13 #include <string.h>14 15 14 #include "rt_names.h" 16 15 #include "utils.h" 17 16 18 #if __GLIBC__ >=2 && __GLIBC_MINOR>= 117 #if defined(__GLIBC__) && __GLIBC__ >=2 && __GLIBC_MINOR__ >= 1 19 18 #include <net/ethernet.h> 20 19 #else … … 25 24 static struct { 26 25 int id; 27 c har *name;26 const char *name; 28 27 } llproto_names[] = { 29 28 __PF(LOOP,loop) … … 98 97 id = ntohs(id); 99 98 100 for (i=0; i <sizeof(llproto_names)/sizeof(llproto_names[0]); i++) {99 for (i=0; i < ARRAY_SIZE(llproto_names); i++) { 101 100 if (llproto_names[i].id == id) 102 101 return llproto_names[i].name; … … 109 108 { 110 109 int i; 111 for (i=0; i <sizeof(llproto_names)/sizeof(llproto_names[0]); i++) {110 for (i=0; i < ARRAY_SIZE(llproto_names); i++) { 112 111 if (strcasecmp(llproto_names[i].name, buf) == 0) { 113 112 *id = htons(llproto_names[i].id);
Note:
See TracChangeset
for help on using the changeset viewer.