Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/networking/ifconfig.c
- Timestamp:
- Dec 20, 2016, 4:07:32 PM (7 years ago)
- Location:
- branches/3.3
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mindi-busybox/networking/ifconfig.c
r3232 r3621 57 57 58 58 #if ENABLE_FEATURE_IFCONFIG_SLIP 59 # include < net/if_slip.h>59 # include <linux/if_slip.h> 60 60 #endif 61 61 … … 265 265 { NULL, 0, ARG_HOSTNAME, (IFF_UP | IFF_RUNNING) } 266 266 }; 267 268 #if ENABLE_FEATURE_IFCONFIG_HW269 /* Input an Ethernet address and convert to binary. */270 static 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 #endif310 267 311 268 int ifconfig_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
Note:
See TracChangeset
for help on using the changeset viewer.