]> git.baikalelectronics.ru Git - kernel.git/commit
batman-adv: fix TT CRC computation by ensuring byte order
authorAntonio Quartulli <antonio@open-mesh.com>
Tue, 11 Feb 2014 16:05:06 +0000 (17:05 +0100)
committerAntonio Quartulli <antonio@meshcoding.com>
Mon, 17 Feb 2014 16:17:02 +0000 (17:17 +0100)
commitc19ec900250032373ab1b597c9e2c88579d998ea
tree29cf55dd314b3025c8fa759278cbaa7c949753ec
parent702685133431d33116727905be1b709909d30c50
batman-adv: fix TT CRC computation by ensuring byte order

When computing the CRC on a 2byte variable the order of
the bytes obviously alters the final result. This means
that computing the CRC over the same value on two archs
having different endianess leads to different numbers.

The global and local translation table CRC computation
routine makes this mistake while processing the clients
VIDs. The result is a continuous CRC mismatching between
nodes having different endianess.

Fix this by converting the VID to Network Order before
processing it. This guarantees that every node uses the same
byte order.

Introduced by 7cf8c00d89df673ec17db1c6756e6a7042478333
("batman-adv: make the TT CRC logic VLAN specific")

Reported-by: Russel Senior <russell@personaltelco.net>
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
Tested-by: Russell Senior <russell@personaltelco.net>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
net/batman-adv/translation-table.c