Author: juhosg
Date: 2014-07-13 21:43:54 +0200 (Sun, 13 Jul 2014)
New Revision: 41622

Modified:
   trunk/target/linux/ar71xx/files/arch/mips/ath79/nvram.c
Log:
ar71xx: allow ath79_nvram_parse_mac_addr parsing mac with quotes

Signed-off-by: Jon Suphammer <[email protected]>
Patchwork: http://patchwork.openwrt.org/patch/5838/
[juhosg:
  - fix coding style,
  - check the first and the last character of the MAC string
    instead of using the strchr() function]
Signed-off-by: Gabor Juhos <[email protected]>

Modified: trunk/target/linux/ar71xx/files/arch/mips/ath79/nvram.c
===================================================================
--- trunk/target/linux/ar71xx/files/arch/mips/ath79/nvram.c     2014-07-13 
18:21:09 UTC (rev 41621)
+++ trunk/target/linux/ar71xx/files/arch/mips/ath79/nvram.c     2014-07-13 
19:43:54 UTC (rev 41622)
@@ -59,6 +59,11 @@
                goto free;
        }
 
+       if (strlen(mac_str) == 19 && mac_str[0] == '"' && mac_str[18] == '"') {
+               mac_str[18] = 0;
+               mac_str++;
+       }
+
        t = sscanf(mac_str, "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx",
                   &mac[0], &mac[1], &mac[2], &mac[3], &mac[4], &mac[5]);
 
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to