]> git.proxmox.com Git - ovs.git/commitdiff
compat: Remove unsupported kernel compat code
authorGreg Rose <gvrose8192@gmail.com>
Sat, 24 Feb 2018 22:04:31 +0000 (14:04 -0800)
committerBen Pfaff <blp@ovn.org>
Tue, 22 May 2018 03:17:04 +0000 (20:17 -0700)
Anything less than 3.10 isn't supported since a couple of releases ago
so remove the dead code.

Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: William Tu <u9012063@gmail.com>
23 files changed:
datapath/linux/compat/include/linux/etherdevice.h
datapath/linux/compat/include/linux/if_vlan.h
datapath/linux/compat/include/linux/kconfig.h
datapath/linux/compat/include/linux/kernel.h
datapath/linux/compat/include/linux/netdev_features.h
datapath/linux/compat/include/linux/netdevice.h
datapath/linux/compat/include/linux/skbuff.h
datapath/linux/compat/include/linux/workqueue.h
datapath/linux/compat/include/net/checksum.h
datapath/linux/compat/include/net/dst.h
datapath/linux/compat/include/net/genetlink.h
datapath/linux/compat/include/net/ip6_route.h
datapath/linux/compat/include/net/ip_tunnels.h
datapath/linux/compat/include/net/ipv6.h
datapath/linux/compat/include/net/netfilter/nf_conntrack_zones.h
datapath/linux/compat/include/net/netlink.h
datapath/linux/compat/include/net/route.h
datapath/linux/compat/ip_gre.c
datapath/linux/compat/ip_tunnel.c
datapath/linux/compat/lisp.c
datapath/linux/compat/stt.c
datapath/linux/compat/udp_tunnel.c
datapath/linux/compat/utils.c

index 850b7798d1989262d518f83547f783803ddba78c..4b27074556e8cb0437358e367d64ca35a908f7a4 100644 (file)
@@ -4,36 +4,6 @@
 #include <linux/version.h>
 #include_next <linux/etherdevice.h>
 
-#ifndef HAVE_ETH_HW_ADDR_RANDOM
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
-static inline void eth_hw_addr_random(struct net_device *dev)
-{
-       random_ether_addr(dev->dev_addr);
-}
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)
-static inline void eth_hw_addr_random(struct net_device *dev)
-{
-       dev_hw_addr_random(dev, dev->dev_addr);
-}
-#endif
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)
-#define eth_mac_addr rpl_eth_mac_addr
-static inline int eth_mac_addr(struct net_device *dev, void *p)
-{
-       struct sockaddr *addr = p;
-
-       if (!is_valid_ether_addr(addr->sa_data))
-               return -EADDRNOTAVAIL;
-#ifdef NET_ADDR_RANDOM
-       dev->addr_assign_type &= ~NET_ADDR_RANDOM;
-#endif
-       memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
-       return 0;
-}
-#endif
-
 #ifndef HAVE_ETHER_ADDR_COPY
 static inline void ether_addr_copy(u8 *dst, const u8 *src)
 {
index fc95b04bfff9cc1e20b5425ed8921977c94b9d0c..2cf18e5fa3f32ac7b684eea06056ca24511b1a0f 100644 (file)
@@ -90,17 +90,6 @@ static inline struct sk_buff *vlan_hwaccel_push_inside(struct sk_buff *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)
-{
-       return __vlan_hwaccel_put_tag(skb, vlan_tci);
-}
-
-#define __vlan_hwaccel_put_tag rpl___vlan_hwaccel_put_tag
-#endif
-
 #ifndef HAVE_ETH_TYPE_VLAN
 /**
  * eth_type_vlan - check for valid vlan ether type.
index 5717a2687b5fc6886bdd50b2a5612b479878dd60..d3fa57a6bcdc090fa207311dc98242ab5f643084 100644 (file)
@@ -3,14 +3,6 @@
 
 #include <linux/version.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
-#define CONFIG_NET_IPGRE_DEMUX 1
-#endif
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)
-#include_next <linux/kconfig.h>
-#endif
-
 #ifndef IS_ENABLED
 
 /*
index 5c4269b01ab4854f6e755d3dfe7e645a5a78c585..2e81abc2fbd98202bbddf792a967ad519838fb36 100644 (file)
@@ -8,44 +8,6 @@
 
 #include <linux/version.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
-#define pr_warn pr_warning
-#endif
-
-/*
- * Print a one-time message (analogous to WARN_ONCE() et al):
- */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 38)
-#undef printk_once
-#define printk_once(fmt, ...)                  \
-({                                             \
-       static bool __print_once;               \
-                                               \
-       if (!__print_once) {                    \
-               __print_once = true;            \
-               printk(fmt, ##__VA_ARGS__);     \
-       }                                       \
-})
-
-#define pr_emerg_once(fmt, ...)                                        \
-       printk_once(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_alert_once(fmt, ...)                                        \
-       printk_once(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_crit_once(fmt, ...)                                 \
-       printk_once(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_err_once(fmt, ...)                                  \
-       printk_once(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_warn_once(fmt, ...)                                 \
-       printk_once(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_notice_once(fmt, ...)                               \
-       printk_once(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_info_once(fmt, ...)                                 \
-       printk_once(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_cont_once(fmt, ...)                                 \
-       printk_once(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__)
-
-#endif
-
 #ifndef USHRT_MAX
 #define USHRT_MAX      ((u16)(~0U))
 #define SHRT_MAX       ((s16)(USHRT_MAX>>1))
index a39bd4ab5001a589e0e385a355476ccf46c19cde..411f2949ba588ca97978e594cfc245fa9e5a49a2 100644 (file)
@@ -1,18 +1,7 @@
 #ifndef __LINUX_NETDEV_FEATURES_WRAPPER_H
 #define __LINUX_NETDEV_FEATURES_WRAPPER_H
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
 #include_next <linux/netdev_features.h>
-#endif
-
-#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7,0)
-/* On RHEL 6, netdev features are defined in netdevice.h header. */
-#include <linux/netdevice.h>
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
-#define NETIF_F_HW_VLAN_CTAG_TX NETIF_F_HW_VLAN_TX
-#endif
 
 #ifndef NETIF_F_GSO_GRE
 #define NETIF_F_GSO_GRE 0
                                 NETIF_F_GSO_MPLS)
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
-#define SKB_GSO_GRE 0
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
-#define SKB_GSO_UDP_TUNNEL 0
-#endif
-
 #ifndef HAVE_NETIF_F_GSO_GRE_CSUM
 #define SKB_GSO_GRE_CSUM 0
 #endif
index 9d3b24903a26fed7d202f009d40c205c127e72d6..29ef6c794f47df440603a7eb02527b6698c6063f 100644 (file)
@@ -37,11 +37,6 @@ struct net;
         alloc_netdev_mq(sizeof_priv, name, setup, 1)
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
-#define unregister_netdevice_queue(dev, head)  unregister_netdevice(dev)
-#define unregister_netdevice_many(head)
-#endif
-
 #ifndef HAVE_DEV_DISABLE_LRO
 extern void dev_disable_lro(struct net_device *dev);
 #endif
index 2910f3f3575ce358eb68336b7738e19caaeea276..149ef28e97029f8f5cbb472a24dcc427cca2359d 100644 (file)
@@ -212,13 +212,6 @@ static inline int skb_orphan_frags(struct sk_buff *skb, gfp_t gfp_mask)
 #define skb_get_hash skb_get_rxhash
 #endif /* HAVE_SKB_GET_HASH */
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)
-static inline void skb_tx_error(struct sk_buff *skb)
-{
-       return;
-}
-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0) */
-
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0)
 #define skb_zerocopy_headlen rpl_skb_zerocopy_headlen
 unsigned int rpl_skb_zerocopy_headlen(const struct sk_buff *from);
index 461fefd0856b338bd2638f686e2d0b25180fef72..ed573c22608cfebf6f1b31409ce8610a5794e695 100644 (file)
@@ -3,8 +3,4 @@
 
 #include_next <linux/workqueue.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
-#define queue_work(wq, dw) schedule_work(dw);
-#endif
-
 #endif
index 398df9324fcbc899b38359c90886b099b493a44e..d1f1125d1f8c44f462ca96d31ce68d9952aaa0b2 100644 (file)
@@ -36,10 +36,4 @@ static inline void csum_replace2(__sum16 *sum, __be16 from, __be16 to)
 #define CSUM_MANGLED_0 ((__force __sum16)0xffff)
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
-#define inet_proto_csum_replace16 rpl_inet_proto_csum_replace16
-void rpl_inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb,
-                                  const __be32 *from, const __be32 *to,
-                                  int pseudohdr);
-#endif
 #endif /* checksum.h */
index 5ec3d307b7b438c7923bf69da277995d23616dbb..af78a6ca62efd03ebd5c9a42b1a8dc91d349554a 100644 (file)
@@ -4,13 +4,6 @@
 #include <linux/version.h>
 #include_next <net/dst.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) &&    \
-    LINUX_VERSION_CODE > KERNEL_VERSION(3,0,20)
-
-#define dst_get_neighbour_noref dst_get_neighbour
-
-#endif
-
 #ifndef HAVE_SKB_DST_ACCESSOR_FUNCS
 
 static inline void skb_dst_drop(struct sk_buff *skb)
@@ -30,19 +23,7 @@ static inline void skb_dst_drop(struct sk_buff *skb)
 #define DST_NOCOUNT            0
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
-static inline void __skb_dst_copy(struct sk_buff *nskb, unsigned long refdst)
-{
-       nskb->_skb_dst = refdst;
-       dst_clone(skb_dst(nskb));
-}
-
-static inline void refdst_drop(unsigned long refdst) { }
-static inline void skb_dst_set_noref(struct sk_buff *skb,
-                                    struct dst_entry *dst) { }
-static inline void dst_init_metrics(struct dst_entry *dst, const u32 *metrics,
-                                   bool read_only) { }
-#elif !defined(HAVE___SKB_DST_COPY)
+#if !defined(HAVE___SKB_DST_COPY)
 static inline void __skb_dst_copy(struct sk_buff *nskb, unsigned long refdst)
 {
        nskb->_skb_refdst = refdst;
@@ -51,13 +32,6 @@ static inline void __skb_dst_copy(struct sk_buff *nskb, unsigned long refdst)
 }
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
-static inline void dst_entries_add(struct dst_ops *ops, int count)
-{
-       atomic_add(count, &ops->entries);
-}
-#endif
-
 #if  LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0)
 static const u32 rpl_dst_default_metrics[RTAX_MAX + 1] = {
        /* This initializer is needed to force linker to place this variable
index b05eae5fa342130c197cf6053ab7d6169ea246db..602ce38d383318ac0791a96004bc8d2f963ec25f 100644 (file)
@@ -6,17 +6,6 @@
 #include <net/net_namespace.h>
 #include_next <net/genetlink.h>
 
-/*
- * 15e473046cb6e5d18a4d0057e61d76315230382b renames pid to portid
- * the affected structures are
- * netlink_skb_parms::pid -> portid
- * genl_info::snd_pid -> snd_portid
- */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
-#define snd_portid snd_pid
-#define portid pid
-#endif
-
 #ifndef HAVE_GENL_NOTIFY_TAKES_FAMILY
 struct rpl_genl_family {
        struct genl_family      compat_family;
index e49ca39fed0b1fdccc96f34e749e11450c7d2245..7c78fd5c6b7fce8e15a1e99a53fa4dfda2290c18 100644 (file)
@@ -7,29 +7,6 @@
 
 #include_next<net/ip6_route.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)
-
-static inline
-struct dst_entry *rpl_ip6_route_output(struct net *net, const struct sock *sk,
-                                  struct flowi6 *fl6)
-{
-       struct flowi fl;
-
-       memset(&fl, 0, sizeof(fl));
-       fl.oif = fl6->flowi6_oif;
-       fl.fl6_dst = fl6->daddr;
-       fl.fl6_src = fl6->saddr;
-       fl.mark = fl6->flowi6_mark;
-       fl.proto = fl6->flowi6_proto;
-
-       return ip6_route_output(net, (struct sock *) sk, &fl);
-}
-#define ip6_route_output rpl_ip6_route_output
-
-#define ip6_dst_hoplimit(dst) dst_metric(dst, RTAX_HOPLIMIT)
-
-#endif /* 2.6.39 */
-
 #ifndef HAVE_NF_IPV6_OPS_FRAGMENT
 int rpl_ip6_fragment(struct sock *sk, struct sk_buff *skb,
                     int (*output)(OVS_VPORT_OUTPUT_PARAMS));
index ae60f09e2a233d13d80db2560203095c1ca26bd4..68dbd7c9c9846e5ef3c128b8e0ee57291b2f3654 100644 (file)
@@ -301,11 +301,7 @@ int rpl_ip_tunnel_newlink(struct net_device *dev, struct nlattr *tb[],
                          struct ip_tunnel_parm *p);
 
 #define ip_tunnel_dellink rpl_ip_tunnel_dellink
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)
 void rpl_ip_tunnel_dellink(struct net_device *dev, struct list_head *head);
-#else
-void rpl_ip_tunnel_dellink(struct net_device *dev);
-#endif
 
 #define ip_tunnel_init_net rpl_ip_tunnel_init_net
 int rpl_ip_tunnel_init_net(struct net *net, int ip_tnl_net_id,
index 48a307a5d0180542f09b47c0ae2e9de8fa373515..7fc03398cefb163ff0b800b5731ce91f16c045f6 100644 (file)
@@ -26,21 +26,6 @@ extern int rpl_ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
                             int target, unsigned short *fragoff, int *fragflg);
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)
-static inline u32 ipv6_addr_hash(const struct in6_addr *a)
-{
-#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
-       const unsigned long *ul = (const unsigned long *)a;
-       unsigned long x = ul[0] ^ ul[1];
-
-       return (u32)(x ^ (x >> 32));
-#else
-       return (__force u32)(a->s6_addr32[0] ^ a->s6_addr32[1] ^
-                            a->s6_addr32[2] ^ a->s6_addr32[3]);
-#endif
-}
-#endif
-
 #ifndef HAVE___IPV6_ADDR_JHASH
 static inline u32 __ipv6_addr_jhash(const struct in6_addr *a, const u32 unused)
 {
index fb43acba31f552e5b45f722cc6738d823a0cba18..d46c098c711943d5fa1bf76d06ecf92d322d08d5 100644 (file)
@@ -3,9 +3,7 @@
 
 #include <linux/version.h>
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)
 #include_next <net/netfilter/nf_conntrack_zones.h>
-#endif
 
 #ifndef HAVE_NF_CT_ZONE_INIT
 
index ba24a34986189878be9b2fab2c785485c3426c4c..d42bf108b417c776d405559da3dc1e1d0044711c 100644 (file)
@@ -16,21 +16,6 @@ static inline __be16 nla_get_be16(const struct nlattr *nla)
 }
 #endif  /* !HAVE_NLA_GET_BE16 */
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)
-/* This function was introduced in 2.6.31, but initially it performed an
- * unaligned access, so we replace it up to 2.6.34 where it was fixed.  */
-#define nla_get_be64 rpl_nla_get_be64
-static inline __be64 nla_get_be64(const struct nlattr *nla)
-{
-       __be64 tmp;
-
-       /* The additional cast is necessary because  */
-       nla_memcpy(&tmp, (struct nlattr *) nla, sizeof(tmp));
-
-       return tmp;
-}
-#endif
-
 #ifndef HAVE_NLA_PUT_BE16
 static inline int nla_put_be16(struct sk_buff *skb, int attrtype, __be16 value)
 {
index 8f336b6955c5c1658467c62ca864fa1bb8d78860..9e4a1f18aa3e7057740ec874b712cdae6e18d807 100644 (file)
@@ -3,109 +3,4 @@
 
 #include_next <net/route.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)
-struct flowi_common {
-       int     flowic_oif;
-       __u32   flowic_mark;
-       __u8    flowic_tos;
-       __u8    flowic_proto;
-};
-
-union flowi_uli {
-       struct {
-               __be16  dport;
-               __be16  sport;
-       } ports;
-
-       struct {
-               __u8    type;
-               __u8    code;
-       } icmpt;
-
-       struct {
-               __le16  dport;
-               __le16  sport;
-       } dnports;
-
-       __be32          spi;
-       __be32          gre_key;
-
-       struct {
-               __u8    type;
-       } mht;
-};
-
-struct flowi4 {
-       struct flowi_common     __fl_common;
-#define flowi4_oif             __fl_common.flowic_oif
-#define flowi4_iif             __fl_common.flowic_iif
-#define flowi4_mark            __fl_common.flowic_mark
-#define flowi4_tos             __fl_common.flowic_tos
-#define flowi4_scope           __fl_common.flowic_scope
-#define flowi4_proto           __fl_common.flowic_proto
-#define flowi4_flags           __fl_common.flowic_flags
-#define flowi4_secid           __fl_common.flowic_secid
-#define flowi4_tun_key         __fl_common.flowic_tun_key
-
-       union flowi_uli         uli;
-#define fl4_gre_key            uli.gre_key
-
-       /* (saddr,daddr) must be grouped, same order as in IP header */
-       __be32                  saddr;
-       __be32                  daddr;
-
-} __attribute__((__aligned__(BITS_PER_LONG/8)));
-
-struct flowi6 {
-       struct flowi_common     __fl_common;
-#define flowi6_oif             __fl_common.flowic_oif
-#define flowi6_iif             __fl_common.flowic_iif
-#define flowi6_mark            __fl_common.flowic_mark
-#define flowi6_tos             __fl_common.flowic_tos
-#define flowi6_scope           __fl_common.flowic_scope
-#define flowi6_proto           __fl_common.flowic_proto
-#define flowi6_flags           __fl_common.flowic_flags
-#define flowi6_secid           __fl_common.flowic_secid
-#define flowi6_tun_key         __fl_common.flowic_tun_key
-       struct in6_addr         daddr;
-       struct in6_addr         saddr;
-       __be32                  flowlabel;
-       union flowi_uli         uli;
-#define fl6_sport              uli.ports.sport
-#define fl6_dport              uli.ports.dport
-#define fl6_icmp_type          uli.icmpt.type
-#define fl6_icmp_code          uli.icmpt.code
-#define fl6_ipsec_spi          uli.spi
-#define fl6_mh_type            uli.mht.type
-#define fl6_gre_key            uli.gre_key
-} __attribute__((__aligned__(BITS_PER_LONG/8)));
-
-static inline struct rtable *rpl_ip_route_output_key(struct net *net, struct flowi4 *flp)
-{
-       struct rtable *rt;
-       /* Tunnel configuration keeps DSCP part of TOS bits, But Linux
-        * router expect RT_TOS bits only.
-        */
-
-       struct flowi fl = { .nl_u = { .ip4_u = {
-                                       .daddr = flp->daddr,
-                                       .saddr = flp->saddr,
-                                       .tos   = RT_TOS(flp->flowi4_tos) } },
-                                       .mark = flp->flowi4_mark,
-                                       .proto = flp->flowi4_proto };
-
-       if (unlikely(ip_route_output_key(net, &rt, &fl)))
-               return ERR_PTR(-EADDRNOTAVAIL);
-       flp->saddr = fl.nl_u.ip4_u.saddr;
-       return rt;
-}
-#define ip_route_output_key rpl_ip_route_output_key
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
-static inline int ip4_dst_hoplimit(const struct dst_entry *dst)
-{
-       return dst_metric(dst, RTAX_HOPLIMIT);
-}
-#endif
 #endif
index 2f297a548e30198caa1d2ef1c317759b9e8c09c5..43048624a33e14985d68ef70836698104cb2fcff 100644 (file)
@@ -365,16 +365,12 @@ static void __gre_tunnel_init(struct net_device *dev)
        dev->mtu                = ETH_DATA_LEN - t_hlen - 4;
 
        dev->features           |= GRE_FEATURES;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)
        dev->hw_features        |= GRE_FEATURES;
-#endif
 
        if (!(tunnel->parms.o_flags & TUNNEL_SEQ)) {
                /* TCP offload with GRE SEQ is not supported. */
                dev->features    |= NETIF_F_GSO_SOFTWARE;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)
                dev->hw_features |= NETIF_F_GSO_SOFTWARE;
-#endif
                /* Can use a lockless transmit, unless we generate
                 * output sequences
                 */
@@ -496,9 +492,7 @@ static const struct net_device_ops gre_tap_netdev_ops = {
 #else
        .ndo_change_mtu         = ip_tunnel_change_mtu,
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)
        .ndo_get_stats64        = ip_tunnel_get_stats64,
-#endif
 #ifdef HAVE_NDO_GET_IFLINK
        .ndo_get_iflink         = ip_tunnel_get_iflink,
 #endif
@@ -515,13 +509,8 @@ static void ipgre_tap_setup(struct net_device *dev)
        ip_tunnel_setup(dev, gre_tap_net_id);
 }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)
 static int ipgre_newlink(struct net *src_net, struct net_device *dev,
                         struct nlattr *tb[], struct nlattr *data[])
-#else
-static int ipgre_newlink(struct net_device *dev,
-                        struct nlattr *tb[], struct nlattr *data[])
-#endif
 {
        struct ip_tunnel_parm p;
        int err;
index be82b557c3e92662dc7f377d0aa5888b744dc681..ebd1544558f9425df64f09c2fd7c6b9c33ae8673 100644 (file)
@@ -168,11 +168,7 @@ static void ip_tunnel_dev_free(struct net_device *dev)
        free_netdev(dev);
 }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)
 void rpl_ip_tunnel_dellink(struct net_device *dev, struct list_head *head)
-#else
-void rpl_ip_tunnel_dellink(struct net_device *dev)
-#endif
 {
        struct ip_tunnel *tunnel = netdev_priv(dev);
        struct ip_tunnel_net *itn;
@@ -180,9 +176,7 @@ void rpl_ip_tunnel_dellink(struct net_device *dev)
        itn = net_generic(tunnel->net, tunnel->ip_tnl_net_id);
 
        ip_tunnel_del(itn, netdev_priv(dev));
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)
-       unregister_netdevice_queue(dev, head);
-#endif
+        unregister_netdevice_queue(dev, head);
 }
 
 int rpl_ip_tunnel_init_net(struct net *net, int ip_tnl_net_id,
index 4882a636a33ee730b2f4dc629185f158b9b92049..41531adf1b0c12a371bdde549f469f50b362c530 100644 (file)
@@ -597,10 +597,8 @@ static void lisp_setup(struct net_device *dev)
        dev->features    |= NETIF_F_RXCSUM;
        dev->features    |= NETIF_F_GSO_SOFTWARE;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)
        dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_RXCSUM;
        dev->hw_features |= NETIF_F_GSO_SOFTWARE;
-#endif
 #ifdef USE_UPSTREAM_TUNNEL
        netif_keep_dst(dev);
 #endif
index ee1c7aa0a78d6ceae9d9e63e6e7ac8cf051879dc..69859e2a4f31abb1772305e8895e6ea8e3f69db3 100644 (file)
@@ -239,9 +239,7 @@ static void copy_skb_metadata(struct sk_buff *to, struct sk_buff *from)
        to->priority = from->priority;
        to->mark = from->mark;
        to->vlan_tci = from->vlan_tci;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
        to->vlan_proto = from->vlan_proto;
-#endif
        skb_copy_secmark(to, from);
 }
 
@@ -762,10 +760,8 @@ static int stt_can_offload(struct sk_buff *skb, __be16 l3_proto, u8 l4_proto)
        if (skb->len + STT_HEADER_LEN + sizeof(struct iphdr) > 65535)
                return 0;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
        if (skb_vlan_tag_present(skb) && skb->vlan_proto != htons(ETH_P_8021Q))
                return 0;
-#endif
        return 1;
 }
 
@@ -792,7 +788,6 @@ static struct sk_buff *handle_offloads(struct sk_buff *skb, int min_headroom)
 {
        int err;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
        if (skb_vlan_tag_present(skb) && skb->vlan_proto != htons(ETH_P_8021Q)) {
 
                min_headroom += VLAN_HLEN;
@@ -812,7 +807,6 @@ static struct sk_buff *handle_offloads(struct sk_buff *skb, int min_headroom)
                        goto error;
                }
        }
-#endif
 
        if (skb_is_gso(skb)) {
                struct sk_buff *nskb;
index 23801bbeb93afaacef2d392cf593a25ac399c62a..852069f627932f109f0cf6fe9de5bc60b7cfb491 100644 (file)
@@ -130,9 +130,7 @@ void rpl_setup_udp_tunnel_sock(struct net *net, struct socket *sock,
 
        udp_sk(sk)->encap_type = cfg->encap_type;
        udp_sk(sk)->encap_rcv = cfg->encap_rcv;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)
        udp_sk(sk)->encap_destroy = cfg->encap_destroy;
-#endif
 #ifdef HAVE_UDP_TUNNEL_SOCK_CFG_GRO_RECEIVE
        udp_sk(sk)->gro_receive = cfg->gro_receive;
        udp_sk(sk)->gro_complete = cfg->gro_complete;
index c9546ea90e4819b0886d8f03f7b909b0faa9180d..a4a98ba65e7312fa98fca7c5a0682576d41f9a44 100644 (file)
 #include <asm/byteorder.h>
 #include <asm/uaccess.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
-void rpl_inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb,
-                                  const __be32 *from, const __be32 *to,
-                                  int pseudohdr)
-{
-       __be32 diff[] = {
-               ~from[0], ~from[1], ~from[2], ~from[3],
-               to[0], to[1], to[2], to[3],
-       };
-       if (skb->ip_summed != CHECKSUM_PARTIAL) {
-               *sum = csum_fold(csum_partial(diff, sizeof(diff),
-                                       ~csum_unfold(*sum)));
-               if (skb->ip_summed == CHECKSUM_COMPLETE && pseudohdr)
-                       skb->csum = ~csum_partial(diff, sizeof(diff),
-                                       ~skb->csum);
-       } else if (pseudohdr)
-               *sum = ~csum_fold(csum_partial(diff, sizeof(diff),
-                                       csum_unfold(*sum)));
-}
-EXPORT_SYMBOL_GPL(rpl_inet_proto_csum_replace16);
-#endif
-
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0)
 
 bool rpl___net_get_random_once(void *buf, int nbytes, bool *done,