From dd0ad0ee962ac309a0f0fff2f4a99397f1be4574 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Tue, 10 May 2011 23:31:34 +0200 Subject: [PATCH] --- yaml --- r: 245311 b: refs/heads/master c: 9cbda726bb283d60cd4f34a3a9da8b5b48a46b0f h: refs/heads/master i: 245309: 56938f37d3f88c0fa7902d84cb8eeee95b9da2b4 245307: 10c5e566487289cb1fc214fd265dcf8ea39b4eff 245303: a66caa85eb384225e0daa2bcef7d95109e0234d9 245295: eb4651ebcade86198ce3a88a2b6099a0e641be44 245279: fb07fd3d4453f738721b9d18ffd4146043602f49 245247: ba530f08ebfe8bf02b43e7bb8b4a933a07765c35 v: v3 --- [refs] | 2 +- trunk/arch/mips/include/asm/mach-bcm47xx/nvram.h | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index c047ec5d3842..812b23fe92c8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 41790fd51f71f3744a5d142cc5369eebab8817a0 +refs/heads/master: 9cbda726bb283d60cd4f34a3a9da8b5b48a46b0f diff --git a/trunk/arch/mips/include/asm/mach-bcm47xx/nvram.h b/trunk/arch/mips/include/asm/mach-bcm47xx/nvram.h index 9759588ba3cf..184d5ecb5f51 100644 --- a/trunk/arch/mips/include/asm/mach-bcm47xx/nvram.h +++ b/trunk/arch/mips/include/asm/mach-bcm47xx/nvram.h @@ -39,8 +39,16 @@ extern int nvram_getenv(char *name, char *val, size_t val_len); static inline void nvram_parse_macaddr(char *buf, u8 *macaddr) { - sscanf(buf, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &macaddr[0], &macaddr[1], - &macaddr[2], &macaddr[3], &macaddr[4], &macaddr[5]); + if (strchr(buf, ':')) + sscanf(buf, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &macaddr[0], + &macaddr[1], &macaddr[2], &macaddr[3], &macaddr[4], + &macaddr[5]); + else if (strchr(buf, '-')) + sscanf(buf, "%hhx-%hhx-%hhx-%hhx-%hhx-%hhx", &macaddr[0], + &macaddr[1], &macaddr[2], &macaddr[3], &macaddr[4], + &macaddr[5]); + else + printk(KERN_WARNING "Can not parse mac address: %s\n", buf); } #endif