aboutsummaryrefslogtreecommitdiff
path: root/toys/other/ifconfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/other/ifconfig.c')
-rw-r--r--toys/other/ifconfig.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/other/ifconfig.c b/toys/other/ifconfig.c
index 6dcda835..a84e26ac 100644
--- a/toys/other/ifconfig.c
+++ b/toys/other/ifconfig.c
@@ -415,7 +415,7 @@ void ifconfig_main(void)
if (*hw_addr == ':') hw_addr++;
sscanf(hw_addr, "%2x%n", &val, &len);
- if (len != 2) break;
+ if (!len || len > 2) break; // 1 nibble can be set e.g. C2:79:38:95:D:A
hw_addr += len;
*p++ = val;
}