]> git.karo-electronics.de Git - karo-tx-linux.git/commit
MIPS: BCM63XX: Properly handle mac address octet overflow
authorJonas Gorski <jonas.gorski@gmail.com>
Tue, 18 Sep 2012 12:09:08 +0000 (14:09 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Sun, 23 Sep 2012 17:28:11 +0000 (19:28 +0200)
commit4e805314d191780f3bdd891fb3dd4c2062533377
tree679f695fdf46e8acb31b47ba0c500713ed3e50b2
parent0d3558848eb25784d20a5f4eed9ec04b35f99bad
MIPS: BCM63XX: Properly handle mac address octet overflow

While calculating the mac address the pointer for the current octet was
never reset back to the least significant one after being decremented
because of an octet overflow. This resulted in the code continuing to
increment at the current octet, potentially generating duplicate or
invalid mac addresses.

As a second issue the pointer was allowed to advance up to the most
significant octet, modifying the OUI, and potentially changing the type
of mac address.

Rewrite the code so it resets the pointer to the least significant
in each outer loop step, and bails out when the least significant octet
of the OUI is reached.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: Maxime Bizon <mbizon@freebox.fr>
Cc: Florian Fainelli <florian@openwrt.org>
Cc: Sergei Shtylyov <sshtylyov@mvista.com>
Patchwork: https://patchwork.linux-mips.org/patch/4348/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/bcm63xx/boards/board_bcm963xx.c