summaryrefslogtreecommitdiff
path: root/datapath
diff options
context:
space:
mode:
authorYang, Yi Y <yi.y.yang@intel.com>2017-02-13 10:39:16 +0800
committerJoe Stringer <joe@ovn.org>2017-03-01 18:00:43 -0800
commit42b0cf5fe74793df27515a9f723b7619ddeae943 (patch)
tree922f8c24ca82d3b98c751c270b2827d0d487e4d9 /datapath
parent27b5fbb25e367a37cf631792ddca19c0ca547824 (diff)
downloadopenvswitch-42b0cf5fe74793df27515a9f723b7619ddeae943.tar.gz
datapath: backport: Fix vlan_insert_tag_set_proto().
Fix cvlan test failure on old kernel versions with 802.1ad. The root cause is the upcall re-inserts the VLAN back into the raw packet data, but the TPID is hard coded to 0x8100. This affects kernels for which HAVE_VLAN_INSERT_TAG_SET_PROTO is not set. The below patch allows the cvlan and 802.ad tests to pass on debian with 3.16 kernel. Signed-off-by: Eric Garver <e@erig.me> Signed-off-by: Yi Yang <yi.y.yang@intel.com> Acked-by: Eric Garver <e@erig.me> Signed-off-by: Joe Stringer <joe@ovn.org>
Diffstat (limited to 'datapath')
-rw-r--r--datapath/linux/compat/include/linux/if_vlan.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/datapath/linux/compat/include/linux/if_vlan.h b/datapath/linux/compat/include/linux/if_vlan.h
index a8d7bfab6..01f7bab68 100644
--- a/datapath/linux/compat/include/linux/if_vlan.h
+++ b/datapath/linux/compat/include/linux/if_vlan.h
@@ -24,8 +24,9 @@
* acceptable.
*/
#define vlan_insert_tag_set_proto(skb, proto, vlan_tci) \
- rpl_vlan_insert_tag_set_proto(skb, vlan_tci)
+ rpl_vlan_insert_tag_set_proto(skb, proto, vlan_tci)
static inline struct sk_buff *rpl_vlan_insert_tag_set_proto(struct sk_buff *skb,
+ __be16 vlan_proto,
u16 vlan_tci)
{
struct vlan_ethhdr *veth;
@@ -41,12 +42,12 @@ static inline struct sk_buff *rpl_vlan_insert_tag_set_proto(struct sk_buff *skb,
skb->mac_header -= VLAN_HLEN;
/* first, the ethernet type */
- veth->h_vlan_proto = htons(ETH_P_8021Q);
+ veth->h_vlan_proto = vlan_proto;
/* now, the TCI */
veth->h_vlan_TCI = htons(vlan_tci);
- skb->protocol = htons(ETH_P_8021Q);
+ skb->protocol = vlan_proto;
return skb;
}