Ignore:
Timestamp:
Dec 20, 2016, 4:07:32 PM (7 years ago)
Author:
Bruno Cornec
Message:

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

Location:
branches/3.3
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi-busybox/networking/nameif.c

    r3232 r3621  
    162162            *next++ = '\0';
    163163        /* Check for selectors, mac= is assumed */
    164         if (strncmp(selector, "bus=", 4) == 0) {
     164        if (is_prefixed_with(selector, "bus=")) {
    165165            ch->bus_info = xstrdup(selector + 4);
    166166            found_selector++;
    167         } else if (strncmp(selector, "driver=", 7) == 0) {
     167        } else if (is_prefixed_with(selector, "driver=")) {
    168168            ch->driver = xstrdup(selector + 7);
    169169            found_selector++;
    170         } else if (strncmp(selector, "phyaddr=", 8) == 0) {
     170        } else if (is_prefixed_with(selector, "phyaddr=")) {
    171171            ch->phy_address = xatoi_positive(selector + 8);
    172172            found_selector++;
     
    174174#endif
    175175            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);
    177177            if (ch->mac == NULL)
    178178                bb_error_msg_and_die("can't parse %s", selector);
     
    293293                continue;
    294294            /* if we came here, all selectors have matched */
    295             break;
     295            goto found;
    296296        }
    297297        /* Nothing found for current interface */
    298         if (!ch)
    299             continue;
    300 
     298        continue;
     299 found:
    301300        if (strcmp(ifr.ifr_name, ch->ifname) != 0) {
    302301            strcpy(ifr.ifr_newname, ch->ifname);
     
    314313        if (ENABLE_FEATURE_CLEAN_UP)
    315314            delete_eth_table(ch);
    316     }
     315    } /* while */
     316
    317317    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;
    319321            delete_eth_table(ch);
     322        }
    320323        config_close(parser);
    321324    };
Note: See TracChangeset for help on using the changeset viewer.