On Monday, May 13, 2013 03:51:15 Antonio Quartulli wrote:
In the gateway code in case of 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.
This trick is correct but the code is not easy to understand and may lead to bugs in case of re-use of ethhdr for other purposes.
Do some code refactoring in order to make it easier to understand and to change in the future.
Signed-off-by: Antonio Quartulli ordex@autistici.org
v2:
- slightly change the commit subject and message
- use __constant_htons() when comparing proto with constants
gateway_client.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
Applied in revision 9eff62f.
Thanks, Marek