mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
compat: Remove skbuff header helper backports.
These have existed largely since v2.6.22, so it's well overdue. Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Jesse Gross <jesse@kernel.org>
This commit is contained in:
@@ -477,10 +477,6 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
|
||||
OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h],
|
||||
[skb_reset_tail_pointer])
|
||||
OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_cow_head])
|
||||
OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_transport_header],
|
||||
[OVS_DEFINE([HAVE_SKBUFF_HEADER_HELPERS])])
|
||||
OVS_GREP_IFELSE([$KSRC/include/linux/icmpv6.h], [icmp6_hdr],
|
||||
[OVS_DEFINE([HAVE_ICMP6_HDR])])
|
||||
OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_warn_if_lro],
|
||||
[OVS_DEFINE([HAVE_SKB_WARN_LRO])])
|
||||
OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [consume_skb])
|
||||
|
@@ -37,15 +37,11 @@ openvswitch_headers += \
|
||||
linux/compat/include/linux/err.h \
|
||||
linux/compat/include/linux/etherdevice.h \
|
||||
linux/compat/include/linux/flex_array.h \
|
||||
linux/compat/include/linux/icmp.h \
|
||||
linux/compat/include/linux/icmpv6.h \
|
||||
linux/compat/include/linux/if.h \
|
||||
linux/compat/include/linux/if_arp.h \
|
||||
linux/compat/include/linux/if_ether.h \
|
||||
linux/compat/include/linux/if_link.h \
|
||||
linux/compat/include/linux/if_vlan.h \
|
||||
linux/compat/include/linux/in.h \
|
||||
linux/compat/include/linux/ip.h \
|
||||
linux/compat/include/linux/ipv6.h \
|
||||
linux/compat/include/linux/jiffies.h \
|
||||
linux/compat/include/linux/kconfig.h \
|
||||
@@ -65,13 +61,10 @@ openvswitch_headers += \
|
||||
linux/compat/include/linux/rcupdate.h \
|
||||
linux/compat/include/linux/reciprocal_div.h \
|
||||
linux/compat/include/linux/rtnetlink.h \
|
||||
linux/compat/include/linux/sctp.h \
|
||||
linux/compat/include/linux/skbuff.h \
|
||||
linux/compat/include/linux/stddef.h \
|
||||
linux/compat/include/linux/tcp.h \
|
||||
linux/compat/include/linux/types.h \
|
||||
linux/compat/include/linux/u64_stats_sync.h \
|
||||
linux/compat/include/linux/udp.h \
|
||||
linux/compat/include/linux/workqueue.h \
|
||||
linux/compat/include/net/checksum.h \
|
||||
linux/compat/include/net/dst.h \
|
||||
|
@@ -1,13 +0,0 @@
|
||||
#ifndef __LINUX_ICMP_WRAPPER_H
|
||||
#define __LINUX_ICMP_WRAPPER_H 1
|
||||
|
||||
#include_next <linux/icmp.h>
|
||||
|
||||
#ifndef HAVE_SKBUFF_HEADER_HELPERS
|
||||
static inline struct icmphdr *icmp_hdr(const struct sk_buff *skb)
|
||||
{
|
||||
return (struct icmphdr *)skb_transport_header(skb);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@@ -1,13 +0,0 @@
|
||||
#ifndef __LINUX_ICMPV6_WRAPPER_H
|
||||
#define __LINUX_ICMPV6_WRAPPER_H 1
|
||||
|
||||
#include_next <linux/icmpv6.h>
|
||||
|
||||
#ifndef HAVE_ICMP6_HDR
|
||||
static inline struct icmp6hdr *icmp6_hdr(const struct sk_buff *skb)
|
||||
{
|
||||
return (struct icmp6hdr *)skb_transport_header(skb);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@@ -1,15 +0,0 @@
|
||||
#ifndef __LINUX_IF_ARP_WRAPPER_H
|
||||
#define __LINUX_IF_ARP_WRAPPER_H 1
|
||||
|
||||
#include_next <linux/if_arp.h>
|
||||
|
||||
#ifndef HAVE_SKBUFF_HEADER_HELPERS
|
||||
#include <linux/skbuff.h>
|
||||
|
||||
static inline struct arphdr *arp_hdr(const struct sk_buff *skb)
|
||||
{
|
||||
return (struct arphdr *)skb_network_header(skb);
|
||||
}
|
||||
#endif /* !HAVE_SKBUFF_HEADER_HELPERS */
|
||||
|
||||
#endif
|
@@ -1,20 +0,0 @@
|
||||
#ifndef __LINUX_IP_WRAPPER_H
|
||||
#define __LINUX_IP_WRAPPER_H 1
|
||||
|
||||
#include_next <linux/ip.h>
|
||||
|
||||
#ifndef HAVE_SKBUFF_HEADER_HELPERS
|
||||
#include <linux/skbuff.h>
|
||||
|
||||
static inline struct iphdr *ip_hdr(const struct sk_buff *skb)
|
||||
{
|
||||
return (struct iphdr *)skb_network_header(skb);
|
||||
}
|
||||
|
||||
static inline unsigned int ip_hdrlen(const struct sk_buff *skb)
|
||||
{
|
||||
return ip_hdr(skb)->ihl * 4;
|
||||
}
|
||||
#endif /* !HAVE_SKBUFF_HEADER_HELPERS */
|
||||
|
||||
#endif
|
@@ -6,13 +6,6 @@
|
||||
struct frag_queue;
|
||||
struct inet_frags;
|
||||
|
||||
#ifndef HAVE_SKBUFF_HEADER_HELPERS
|
||||
static inline struct ipv6hdr *ipv6_hdr(const struct sk_buff *skb)
|
||||
{
|
||||
return (struct ipv6hdr *)skb_network_header(skb);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
|
||||
void rpl_ip6_expire_frag_queue(struct net *net, struct frag_queue *fq,
|
||||
struct inet_frags *frags);
|
||||
|
@@ -1,13 +0,0 @@
|
||||
#ifndef __LINUX_SCTP_WRAPPER_H
|
||||
#define __LINUX_SCTP_WRAPPER_H 1
|
||||
|
||||
#include_next <linux/sctp.h>
|
||||
|
||||
#ifndef HAVE_SKBUFF_HEADER_HELPERS
|
||||
static inline struct sctphdr *sctp_hdr(const struct sk_buff *skb)
|
||||
{
|
||||
return (struct sctphdr *)skb_transport_header(skb);
|
||||
}
|
||||
#endif /* HAVE_SKBUFF_HEADER_HELPERS */
|
||||
|
||||
#endif
|
@@ -111,71 +111,6 @@ static inline struct rtable *skb_rtable(const struct sk_buff *skb)
|
||||
#define CHECKSUM_COMPLETE CHECKSUM_HW
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_SKBUFF_HEADER_HELPERS
|
||||
static inline unsigned char *skb_transport_header(const struct sk_buff *skb)
|
||||
{
|
||||
return skb->h.raw;
|
||||
}
|
||||
|
||||
static inline void skb_reset_transport_header(struct sk_buff *skb)
|
||||
{
|
||||
skb->h.raw = skb->data;
|
||||
}
|
||||
|
||||
static inline void skb_set_transport_header(struct sk_buff *skb,
|
||||
const int offset)
|
||||
{
|
||||
skb->h.raw = skb->data + offset;
|
||||
}
|
||||
|
||||
static inline unsigned char *skb_network_header(const struct sk_buff *skb)
|
||||
{
|
||||
return skb->nh.raw;
|
||||
}
|
||||
|
||||
static inline void skb_reset_network_header(struct sk_buff *skb)
|
||||
{
|
||||
skb->nh.raw = skb->data;
|
||||
}
|
||||
|
||||
static inline void skb_set_network_header(struct sk_buff *skb, const int offset)
|
||||
{
|
||||
skb->nh.raw = skb->data + offset;
|
||||
}
|
||||
|
||||
static inline unsigned char *skb_mac_header(const struct sk_buff *skb)
|
||||
{
|
||||
return skb->mac.raw;
|
||||
}
|
||||
|
||||
static inline void skb_reset_mac_header(struct sk_buff *skb)
|
||||
{
|
||||
skb->mac_header = skb->data;
|
||||
}
|
||||
|
||||
static inline void skb_set_mac_header(struct sk_buff *skb, const int offset)
|
||||
{
|
||||
skb->mac.raw = skb->data + offset;
|
||||
}
|
||||
|
||||
static inline int skb_transport_offset(const struct sk_buff *skb)
|
||||
{
|
||||
return skb_transport_header(skb) - skb->data;
|
||||
}
|
||||
|
||||
static inline int skb_network_offset(const struct sk_buff *skb)
|
||||
{
|
||||
return skb_network_header(skb) - skb->data;
|
||||
}
|
||||
|
||||
static inline void skb_copy_to_linear_data(struct sk_buff *skb,
|
||||
const void *from,
|
||||
const unsigned int len)
|
||||
{
|
||||
memcpy(skb->data, from, len);
|
||||
}
|
||||
#endif /* !HAVE_SKBUFF_HEADER_HELPERS */
|
||||
|
||||
#ifndef HAVE_SKB_WARN_LRO
|
||||
#ifndef NETIF_F_LRO
|
||||
static inline bool skb_warn_if_lro(const struct sk_buff *skb)
|
||||
|
@@ -1,18 +0,0 @@
|
||||
#ifndef __LINUX_TCP_WRAPPER_H
|
||||
#define __LINUX_TCP_WRAPPER_H 1
|
||||
|
||||
#include_next <linux/tcp.h>
|
||||
|
||||
#ifndef HAVE_SKBUFF_HEADER_HELPERS
|
||||
static inline struct tcphdr *tcp_hdr(const struct sk_buff *skb)
|
||||
{
|
||||
return (struct tcphdr *)skb_transport_header(skb);
|
||||
}
|
||||
|
||||
static inline unsigned int tcp_hdrlen(const struct sk_buff *skb)
|
||||
{
|
||||
return tcp_hdr(skb)->doff * 4;
|
||||
}
|
||||
#endif /* !HAVE_SKBUFF_HEADER_HELPERS */
|
||||
|
||||
#endif
|
@@ -1,18 +0,0 @@
|
||||
#ifndef __LINUX_UDP_WRAPPER_H
|
||||
#define __LINUX_UDP_WRAPPER_H 1
|
||||
|
||||
#include_next <linux/udp.h>
|
||||
|
||||
#ifndef HAVE_SKBUFF_HEADER_HELPERS
|
||||
static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
|
||||
{
|
||||
return (struct udphdr *)skb_transport_header(skb);
|
||||
}
|
||||
#endif /* HAVE_SKBUFF_HEADER_HELPERS */
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
|
||||
static inline void udp_encap_enable(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
#endif
|
Reference in New Issue
Block a user