[OpenWrt-Devel] [PATCH 1/3][ESR1750][V2] ar71xx: allow ath79_nvram_parse_mac_addr parsing mac with quotes

Jon Suphammer jon at suphammer.net
Mon Jul 7 08:32:17 EDT 2014


Signed-off-by: Jon Suphammer <jon at suphammer.net>
---
 target/linux/ar71xx/files/arch/mips/ath79/nvram.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/nvram.c b/target/linux/ar71xx/files/arch/mips/ath79/nvram.c
index 43911b8..3119778 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/nvram.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/nvram.c
@@ -59,6 +59,12 @@ int ath79_nvram_parse_mac_addr(const char *nvram, unsigned nvram_len,
 		goto free;
 	}
 
+	if( strlen(mac_str) == 19 && strchr(mac_str, '"'))
+	{
+		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]);
 
-- 
2.0.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list