From 1d12fb66550660f97ef90484dc31304eddfd4bf7 Mon Sep 17 00:00:00 2001 From: Ashwini sharma Date: Sun, 13 Apr 2014 16:04:16 -0500 Subject: An issue in ifconfig while verifying the HW Address, which is assumed to be of the format __C2:79:38:95:CD:AB__ but can be of form __C2:79:38:95:D:A__. In this case the HW address is reported as bad. --- toys/other/ifconfig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v1.2.3