dpif-netdev: Properly track whether there is a vlan header.
authorBen Pfaff <blp@nicira.com>
Wed, 28 Jul 2010 00:00:54 +0000 (17:00 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 10 Aug 2010 18:44:54 +0000 (11:44 -0700)
commit142181fcd734a2afff9fe13e54fe51c7a2c824d2
treed751895a4a00f593cdbe10363ff4c60e81e86625
parent1805876e50b89816581dac16d7283bd130b84c72
dpif-netdev: Properly track whether there is a vlan header.

It looks to me like the current dpif-netdev implementation doesn't handle
the case where a packet comes in without a VLAN and then is subjected to
multiple ODPAT_SET_VLAN_* operations.  dp_netdev_modify_vlan_tci() just
checks the flow key each time to see whether there's a VLAN, but it doesn't
update the flow key to note that there is now a VLAN.

One fix would be to update the flow key, but it's "const" these days.
Instead, add a check for whether the Ethernet type is ETH_TYPE_VLAN,
which should be equivalent.
lib/dpif-netdev.c