@@ -522,8 +522,7 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_checksum_start_offset])
OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [inner_protocol])
OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [inner_protocol_type])
- OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [inner_mac_header])
- OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [inner_network_header])
+ OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_inner_transport_offset])
OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [kfree_skb_list])
OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_scrub_packet.*xnet],
[OVS_DEFINE([HAVE_SKB_SCRUB_PACKET_XNET])])
@@ -17,12 +17,6 @@ struct ovs_gso_cb {
#ifndef HAVE_INNER_PROTOCOL
__be16 inner_protocol;
#endif
-#ifndef HAVE_INNER_MAC_HEADER
- unsigned int inner_mac_header;
-#endif
-#ifndef HAVE_INNER_NETWORK_HEADER
- unsigned int inner_network_header;
-#endif
bool ipv6;
};
#define OVS_GSO_CB(skb) ((struct ovs_gso_cb *)(skb)->cb)
@@ -44,59 +38,6 @@ static inline void skb_clear_ovs_gso_cb(struct sk_buff *skb)
}
#endif
-#ifndef HAVE_INNER_MAC_HEADER
-static inline unsigned char *skb_inner_mac_header(const struct sk_buff *skb)
-{
- return skb->head + OVS_GSO_CB(skb)->inner_mac_header;
-}
-
-static inline void skb_set_inner_mac_header(const struct sk_buff *skb,
- int offset)
-{
- OVS_GSO_CB(skb)->inner_mac_header = (skb->data - skb->head) + offset;
-}
-#endif /* HAVE_INNER_MAC_HEADER */
-
-#ifndef HAVE_INNER_NETWORK_HEADER
-static inline unsigned char *skb_inner_network_header(const struct sk_buff *skb)
-{
- return skb->head + OVS_GSO_CB(skb)->inner_network_header;
-}
-
-static inline int skb_inner_network_offset(const struct sk_buff *skb)
-{
- return skb_inner_network_header(skb) - skb->data;
-}
-
-/* We don't actually store the transport offset on backports because
- * we don't use it anywhere. Slightly rename this version to avoid
- * future users from picking it up accidentially.
- */
-static inline int ovs_skb_inner_transport_offset(const struct sk_buff *skb)
-{
- return 0;
-}
-
-static inline void skb_set_inner_network_header(const struct sk_buff *skb,
- int offset)
-{
- OVS_GSO_CB(skb)->inner_network_header = (skb->data - skb->head)
- + offset;
-}
-
-static inline void skb_set_inner_transport_header(const struct sk_buff *skb,
- int offset)
-{ }
-
-#else
-
-static inline int ovs_skb_inner_transport_offset(const struct sk_buff *skb)
-{
- return skb_inner_transport_header(skb) - skb->data;
-}
-
-#endif /* HAVE_INNER_NETWORK_HEADER */
-
#ifndef HAVE_INNER_PROTOCOL
static inline void ovs_skb_init_inner_protocol(struct sk_buff *skb)
{
@@ -138,7 +79,7 @@ static inline void ovs_skb_set_inner_protocol(struct sk_buff *skb,
skb->inner_protocol = ethertype;
}
#endif /* ENCAP_TYPE_ETHER */
-#endif /* 3.11 */
+#endif /* HAVE_INNER_PROTOCOL */
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)
#define ip_local_out rpl_ip_local_out
@@ -151,15 +92,6 @@ static inline int skb_inner_mac_offset(const struct sk_buff *skb)
#define ip6_local_out rpl_ip6_local_out
int rpl_ip6_local_out(struct sk_buff *skb);
-
-#define skb_reset_inner_headers rpl_skb_reset_inner_headers
-static inline void skb_reset_inner_headers(struct sk_buff *skb)
-{
- BUILD_BUG_ON(sizeof(struct ovs_gso_cb) > FIELD_SIZEOF(struct sk_buff, cb));
- skb_set_inner_mac_header(skb, skb_mac_header(skb) - skb->data);
- skb_set_inner_network_header(skb, skb_network_offset(skb));
- skb_set_inner_transport_header(skb, skb_transport_offset(skb));
-}
#endif /* 3.18 */
#ifndef USE_UPSTREAM_TUNNEL
@@ -39,6 +39,13 @@ static inline void skb_copy_to_linear_data_offset(struct sk_buff *skb,
#endif /* !HAVE_SKB_COPY_FROM_LINEAR_DATA_OFFSET */
+#ifndef HAVE_SKB_INNER_TRANSPORT_OFFSET
+static inline int skb_inner_transport_offset(const struct sk_buff *skb)
+{
+ return skb_inner_transport_header(skb) - skb->data;
+}
+#endif
+
#ifndef HAVE_SKB_RESET_TAIL_POINTER
static inline void skb_reset_tail_pointer(struct sk_buff *skb)
{
@@ -248,7 +248,7 @@ int rpl_pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
inner_mac_offset = skb_inner_mac_offset(skb);
inner_nw_offset = skb_inner_network_offset(skb);
- inner_transport_offset = ovs_skb_inner_transport_offset(skb);
+ inner_transport_offset = skb_inner_transport_offset(skb);
#undef pskb_expand_head
err = pskb_expand_head(skb, nhead, ntail, gfp_mask);