OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [ADD_ALL_VLANS_CMD],
[OVS_DEFINE([HAVE_VLAN_BUG_WORKAROUND])])
+ OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [vlan_insert_tag_set_proto])
OVS_GREP_IFELSE([$KSRC/include/linux/u64_stats_sync.h], [u64_stats_fetch_begin_irq])
/* push down current VLAN tag */
current_tag = vlan_tx_tag_get(skb);
- if (!__vlan_put_tag(skb, skb->vlan_proto, current_tag))
+ if (!vlan_insert_tag_set_proto(skb, skb->vlan_proto, current_tag))
return -ENOMEM;
/* Update mac_len for subsequent MPLS actions */
skb->mac_len += VLAN_HLEN;
if (!nskb)
return -ENOMEM;
- nskb = __vlan_put_tag(nskb, nskb->vlan_proto, vlan_tx_tag_get(nskb));
+ nskb = vlan_insert_tag_set_proto(nskb, nskb->vlan_proto, vlan_tx_tag_get(nskb));
if (!nskb)
return -ENOMEM;
features &= ~(NETIF_F_TSO | NETIF_F_TSO6 |
NETIF_F_UFO | NETIF_F_FSO);
- skb = __vlan_put_tag(skb, skb->vlan_proto,
- vlan_tx_tag_get(skb));
+ skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto,
+ vlan_tx_tag_get(skb));
if (unlikely(!skb))
return err;
vlan_set_tci(skb, 0);
#include <linux/version.h>
#include_next <linux/if_vlan.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+#ifndef HAVE_VLAN_INSERT_TAG_SET_PROTO
/*
- * The behavior of __vlan_put_tag() has changed over time:
+ * The behavior of __vlan_put_tag()/vlan_insert_tag_set_proto() has changed
+ * over time:
*
* - In 2.6.26 and earlier, it adjusted both MAC and network header
* pointers. (The latter didn't make any sense.)
*
* - In 2.6.29 and later, it adjusts the MAC header pointer only.
*
+ * - In 3.19 and later, it was renamed to vlan_insert_tag_set_proto()
+ *
* This is the version from 2.6.33. We unconditionally substitute this version
* to avoid the need to guess whether the version in the kernel tree is
* acceptable.
*/
-#define __vlan_put_tag(skb, proto, tag) rpl__vlan_put_tag(skb, tag)
-
-static inline struct sk_buff *rpl__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci)
+#define vlan_insert_tag_set_proto(skb, proto, vlan_tci) \
+ rpl_vlan_insert_tag_set_proto(skb, vlan_tci)
+static inline struct sk_buff *rpl_vlan_insert_tag_set_proto(struct sk_buff *skb,
+ u16 vlan_tci)
{
struct vlan_ethhdr *veth;
return skb;
}
+#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
static inline struct sk_buff *rpl___vlan_hwaccel_put_tag(struct sk_buff *skb,
__be16 vlan_proto,
u16 vlan_tci)
}
#define __vlan_hwaccel_put_tag rpl___vlan_hwaccel_put_tag
-
#endif
/* All of these were introduced in a single commit preceding 2.6.33, so
}
if (vlan_tx_tag_present(skb)) {
- if (unlikely(!__vlan_put_tag(skb,
- skb->vlan_proto,
- vlan_tx_tag_get(skb))))
+ if (unlikely(!vlan_insert_tag_set_proto(skb,
+ skb->vlan_proto,
+ vlan_tx_tag_get(skb))))
return -ENOMEM;
vlan_set_tci(skb, 0);
}
if (vlan_tx_tag_present(skb)) {
- if (unlikely(!__vlan_put_tag(skb,
- skb->vlan_proto,
- vlan_tx_tag_get(skb)))) {
+ if (unlikely(!vlan_insert_tag_set_proto(skb,
+ skb->vlan_proto,
+ vlan_tx_tag_get(skb)))) {
err = -ENOMEM;
skb = NULL;
goto err_free_rt;
}
if (vlan_tx_tag_present(skb)) {
- if (unlikely(!__vlan_put_tag(skb,
- skb->vlan_proto,
- vlan_tx_tag_get(skb)))) {
+ if (unlikely(!vlan_insert_tag_set_proto(skb,
+ skb->vlan_proto,
+ vlan_tx_tag_get(skb)))) {
err = -ENOMEM;
skb = NULL;
goto err_free_rt;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
if (vlan_tx_tag_present(skb)) {
- if (unlikely(!__vlan_put_tag(skb,
- skb->vlan_proto,
- vlan_tx_tag_get(skb))))
+ if (unlikely(!vlan_insert_tag_set_proto(skb,
+ skb->vlan_proto,
+ vlan_tx_tag_get(skb))))
return 0;
if (skb->ip_summed == CHECKSUM_COMPLETE)