Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/networking/libiproute/ll_proto.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 983 by niro, Fri Apr 24 18:33:46 2009 UTC revision 984 by niro, Sun May 30 11:32:42 2010 UTC
# Line 98  __PF(ECONET,econet) Line 98  __PF(ECONET,econet)
98  #undef __PF  #undef __PF
99    
100    
101  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)
102  {  {
103   unsigned i;   unsigned i;
104   id = ntohs(id);   id = ntohs(id);
# Line 110  const char *ll_proto_n2a(unsigned short Line 110  const char *ll_proto_n2a(unsigned short
110   return buf;   return buf;
111  }  }
112    
113  int ll_proto_a2n(unsigned short *id, char *buf)  int FAST_FUNC ll_proto_a2n(unsigned short *id, char *buf)
114  {  {
115   unsigned i;   unsigned i;
116   for (i = 0; i < ARRAY_SIZE(llproto_names); i++) {   for (i = 0; i < ARRAY_SIZE(llproto_names); i++) {
117   if (strcasecmp(llproto_names[i].name, buf) == 0) {   if (strcasecmp(llproto_names[i].name, buf) == 0) {
118   *id = htons(llproto_names[i].id);   i = llproto_names[i].id;
119   return 0;   goto good;
120   }   }
121   }   }
122   if (get_u16(id, buf, 0))   i = bb_strtou(buf, NULL, 0);
123     if (errno || i > 0xffff)
124   return -1;   return -1;
125   *id = htons(*id);   good:
126     *id = htons(i);
127   return 0;   return 0;
128  }  }
129    

Legend:
Removed from v.983  
changed lines
  Added in v.984