batman-adv: h_vlan_encapsulated_proto access refactoring
authorAntonio Quartulli <ordex@autistici.org>
Sun, 12 May 2013 19:51:15 +0000 (21:51 +0200)
committerAntonio Quartulli <antonio@meshcoding.com>
Sat, 12 Oct 2013 09:58:30 +0000 (11:58 +0200)
commitf7f8ed5695ef441495cfab5287951927d9d5f12e
treebce239bcd43bdb8e61c7162d1f314adb32b1e7d2
parent210260594782ba9bc52732d84880573466c13441
batman-adv: h_vlan_encapsulated_proto access refactoring

In case of a VLAN tagged frame the ethhdr pointer is
moved forward by 4 bytes so that the offset of h_proto
in struct ethhdr matches the real
h_vlan_encapsulated_proto address in the skb. While this
trickery is correct it makes the code harder to understand
and may lead to bugs in case of re-use of ethhdr for other
purposes.

This patch introduces a proto variable to make things
cleaner and easier to understand.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
net/batman-adv/gateway_client.c