diff options
Diffstat (limited to 'networking/nameif.c')
-rw-r--r-- | networking/nameif.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/networking/nameif.c b/networking/nameif.c index 9a8846dc0..9b18a6d16 100644 --- a/networking/nameif.c +++ b/networking/nameif.c | |||
@@ -161,19 +161,19 @@ static void nameif_parse_selector(ethtable_t *ch, char *selector) | |||
161 | if (*next) | 161 | if (*next) |
162 | *next++ = '\0'; | 162 | *next++ = '\0'; |
163 | /* Check for selectors, mac= is assumed */ | 163 | /* Check for selectors, mac= is assumed */ |
164 | if (strncmp(selector, "bus=", 4) == 0) { | 164 | if (is_prefixed_with(selector, "bus=")) { |
165 | ch->bus_info = xstrdup(selector + 4); | 165 | ch->bus_info = xstrdup(selector + 4); |
166 | found_selector++; | 166 | found_selector++; |
167 | } else if (strncmp(selector, "driver=", 7) == 0) { | 167 | } else if (is_prefixed_with(selector, "driver=")) { |
168 | ch->driver = xstrdup(selector + 7); | 168 | ch->driver = xstrdup(selector + 7); |
169 | found_selector++; | 169 | found_selector++; |
170 | } else if (strncmp(selector, "phyaddr=", 8) == 0) { | 170 | } else if (is_prefixed_with(selector, "phyaddr=")) { |
171 | ch->phy_address = xatoi_positive(selector + 8); | 171 | ch->phy_address = xatoi_positive(selector + 8); |
172 | found_selector++; | 172 | found_selector++; |
173 | } else { | 173 | } else { |
174 | #endif | 174 | #endif |
175 | lmac = xmalloc(ETH_ALEN); | 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 | if (ch->mac == NULL) | 177 | if (ch->mac == NULL) |
178 | bb_error_msg_and_die("can't parse %s", selector); | 178 | bb_error_msg_and_die("can't parse %s", selector); |
179 | #if ENABLE_FEATURE_NAMEIF_EXTENDED | 179 | #if ENABLE_FEATURE_NAMEIF_EXTENDED |