Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/networking/nameif.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/nameif.c
r3232 r3621 162 162 *next++ = '\0'; 163 163 /* Check for selectors, mac= is assumed */ 164 if ( strncmp(selector, "bus=", 4) == 0) {164 if (is_prefixed_with(selector, "bus=")) { 165 165 ch->bus_info = xstrdup(selector + 4); 166 166 found_selector++; 167 } else if ( strncmp(selector, "driver=", 7) == 0) {167 } else if (is_prefixed_with(selector, "driver=")) { 168 168 ch->driver = xstrdup(selector + 7); 169 169 found_selector++; 170 } else if ( strncmp(selector, "phyaddr=", 8) == 0) {170 } else if (is_prefixed_with(selector, "phyaddr=")) { 171 171 ch->phy_address = xatoi_positive(selector + 8); 172 172 found_selector++; … … 174 174 #endif 175 175 lmac = xmalloc(ETH_ALEN); 176 ch->mac = ether_aton_r(selector + ( strncmp(selector, "mac=", 4) != 0 ? 0 : 4), lmac);176 ch->mac = ether_aton_r(selector + (is_prefixed_with(selector, "mac=") ? 4 : 0), lmac); 177 177 if (ch->mac == NULL) 178 178 bb_error_msg_and_die("can't parse %s", selector); … … 293 293 continue; 294 294 /* if we came here, all selectors have matched */ 295 break;295 goto found; 296 296 } 297 297 /* Nothing found for current interface */ 298 if (!ch) 299 continue; 300 298 continue; 299 found: 301 300 if (strcmp(ifr.ifr_name, ch->ifname) != 0) { 302 301 strcpy(ifr.ifr_newname, ch->ifname); … … 314 313 if (ENABLE_FEATURE_CLEAN_UP) 315 314 delete_eth_table(ch); 316 } 315 } /* while */ 316 317 317 if (ENABLE_FEATURE_CLEAN_UP) { 318 for (ch = clist; ch; ch = ch->next) 318 ethtable_t *next; 319 for (ch = clist; ch; ch = next) { 320 next = ch->next; 319 321 delete_eth_table(ch); 322 } 320 323 config_close(parser); 321 324 };
Note:
See TracChangeset
for help on using the changeset viewer.