diff options
Diffstat (limited to 'networking/ifupdown.c')
-rw-r--r-- | networking/ifupdown.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index c35d97a1a..daabeec0c 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c | |||
@@ -289,7 +289,7 @@ static char *parse(const char *command, struct interface_defn_t *ifd) | |||
289 | /* "hwaddress <class> <address>": | 289 | /* "hwaddress <class> <address>": |
290 | * unlike ifconfig, ip doesnt want <class> | 290 | * unlike ifconfig, ip doesnt want <class> |
291 | * (usually "ether" keyword). Skip it. */ | 291 | * (usually "ether" keyword). Skip it. */ |
292 | if (strncmp(command, "hwaddress", 9) == 0) { | 292 | if (is_prefixed_with(command, "hwaddress")) { |
293 | varvalue = skip_whitespace(skip_non_whitespace(varvalue)); | 293 | varvalue = skip_whitespace(skip_non_whitespace(varvalue)); |
294 | } | 294 | } |
295 | # endif | 295 | # endif |
@@ -298,7 +298,7 @@ static char *parse(const char *command, struct interface_defn_t *ifd) | |||
298 | # if ENABLE_FEATURE_IFUPDOWN_IP | 298 | # if ENABLE_FEATURE_IFUPDOWN_IP |
299 | /* Sigh... Add a special case for 'ip' to convert from | 299 | /* Sigh... Add a special case for 'ip' to convert from |
300 | * dotted quad to bit count style netmasks. */ | 300 | * dotted quad to bit count style netmasks. */ |
301 | if (strncmp(command, "bnmask", 6) == 0) { | 301 | if (is_prefixed_with(command, "bnmask")) { |
302 | unsigned res; | 302 | unsigned res; |
303 | varvalue = get_var("netmask", 7, ifd); | 303 | varvalue = get_var("netmask", 7, ifd); |
304 | if (varvalue) { | 304 | if (varvalue) { |
@@ -1159,12 +1159,12 @@ static char *run_mapping(char *physical, struct mapping_defn_t *map) | |||
1159 | 1159 | ||
1160 | static llist_t *find_iface_state(llist_t *state_list, const char *iface) | 1160 | static llist_t *find_iface_state(llist_t *state_list, const char *iface) |
1161 | { | 1161 | { |
1162 | unsigned iface_len = strlen(iface); | ||
1163 | llist_t *search = state_list; | 1162 | llist_t *search = state_list; |
1164 | 1163 | ||
1165 | while (search) { | 1164 | while (search) { |
1166 | if ((strncmp(search->data, iface, iface_len) == 0) | 1165 | char *after_iface = is_prefixed_with(search->data, iface); |
1167 | && (search->data[iface_len] == '=') | 1166 | if (after_iface |
1167 | && *after_iface == '=' | ||
1168 | ) { | 1168 | ) { |
1169 | return search; | 1169 | return search; |
1170 | } | 1170 | } |