tunneling: Rely on protocol handles to parse ToS.
authorJesse Gross <jesse@nicira.com>
Wed, 9 Mar 2011 01:33:14 +0000 (17:33 -0800)
committerJesse Gross <jesse@nicira.com>
Thu, 10 Mar 2011 19:50:06 +0000 (11:50 -0800)
commitaae369c706cd56886f8560c43960110f79e062dc
treef2cadefcfabaea68c7a69b58075ac6d859b1000d
parent132b0dccf4a86614b468790dcc26d49fde4e08d9
tunneling: Rely on protocol handles to parse ToS.

Currently the generic tunneling code assumes that on receive the
outer IP header is present on the packet and the protocol pointers
are initialized to it.  This knowledge is used in only one place,
which is to copy ECN bits from outer to inner IP packets.  These
assumptions are difficult to keep track of because the receive code
generally uses the protocol pointers for the inner packet.  A
number of bugs have resulted from incorrect assumptions, including
one fixed here about the location of a vlan header.  This drops the
convention and instead uses the protocol handles to supply the ToS,
which is less error-prone.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath/tunnel.c
datapath/tunnel.h
datapath/vport-capwap.c
datapath/vport-gre.c