batman-adv: Drop compat code for Linux < 5.4
The lowest kernel version supported by OpenWrt at the moment is Linux 5.4. It is therefore not required to have these dead code sections anymore. Signed-off-by: Sven Eckelmann <sven@narfation.org>
This commit is contained in:
parent
ea4a3f28dc
commit
39cf9f5b47
2 changed files with 1 additions and 101 deletions
|
@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk
|
|||
|
||||
PKG_NAME:=batman-adv
|
||||
PKG_VERSION:=2020.4
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
|
||||
|
|
|
@ -5,106 +5,6 @@
|
|||
#include <linux/version.h> /* LINUX_VERSION_CODE */
|
||||
#include <linux/types.h>
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
|
||||
|
||||
#include <linux/netdevice.h>
|
||||
|
||||
#define netdev_master_upper_dev_link(dev, upper_dev, upper_priv, upper_info, extack) ({\
|
||||
BUILD_BUG_ON(extack != NULL); \
|
||||
netdev_master_upper_dev_link(dev, upper_dev, upper_priv, upper_info); \
|
||||
})
|
||||
|
||||
#endif /* < KERNEL_VERSION(4, 15, 0) */
|
||||
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)
|
||||
|
||||
#ifndef sizeof_field
|
||||
#define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER))
|
||||
#endif
|
||||
|
||||
#endif /* < KERNEL_VERSION(4, 16, 0) */
|
||||
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
|
||||
|
||||
#include_next <linux/igmp.h>
|
||||
#include_next <net/addrconf.h>
|
||||
|
||||
static inline int batadv_ipv6_mc_check_mld1(struct sk_buff *skb)
|
||||
{
|
||||
return ipv6_mc_check_mld(skb, NULL);
|
||||
}
|
||||
|
||||
static inline int batadv_ipv6_mc_check_mld2(struct sk_buff *skb,
|
||||
struct sk_buff **skb_trimmed)
|
||||
{
|
||||
return ipv6_mc_check_mld(skb, skb_trimmed);
|
||||
}
|
||||
|
||||
#define ipv6_mc_check_mld_get(_1, _2, ipv6_mc_check_mld_name, ...) ipv6_mc_check_mld_name
|
||||
#define ipv6_mc_check_mld(...) \
|
||||
ipv6_mc_check_mld_get(__VA_ARGS__, batadv_ipv6_mc_check_mld2, batadv_ipv6_mc_check_mld1)(__VA_ARGS__)
|
||||
|
||||
static inline int batadv_ip_mc_check_igmp1(struct sk_buff *skb)
|
||||
{
|
||||
return ip_mc_check_igmp(skb, NULL);
|
||||
}
|
||||
|
||||
static inline int batadv_ip_mc_check_igmp2(struct sk_buff *skb,
|
||||
struct sk_buff **skb_trimmed)
|
||||
{
|
||||
return ip_mc_check_igmp(skb, skb_trimmed);
|
||||
}
|
||||
|
||||
#define ip_mc_check_igmp_get(_1, _2, ip_mc_check_igmp_name, ...) ip_mc_check_igmp_name
|
||||
#define ip_mc_check_igmp(...) \
|
||||
ip_mc_check_igmp_get(__VA_ARGS__, batadv_ip_mc_check_igmp2, batadv_ip_mc_check_igmp1)(__VA_ARGS__)
|
||||
|
||||
#endif /* < KERNEL_VERSION(5, 1, 0) */
|
||||
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
|
||||
|
||||
#define batadv_softif_slave_add(__dev, __slave_dev, __extack) \
|
||||
batadv_softif_slave_add(__dev, __slave_dev)
|
||||
|
||||
#endif /* < KERNEL_VERSION(4, 15, 0) */
|
||||
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
|
||||
|
||||
static inline int batadv_access_ok(int type, const void __user *p,
|
||||
unsigned long size)
|
||||
{
|
||||
return access_ok(type, p, size);
|
||||
}
|
||||
|
||||
#ifdef access_ok
|
||||
#undef access_ok
|
||||
#endif
|
||||
|
||||
#define access_ok_get(_1, _2, _3 , access_ok_name, ...) access_ok_name
|
||||
#define access_ok(...) \
|
||||
access_ok_get(__VA_ARGS__, access_ok3, access_ok2)(__VA_ARGS__)
|
||||
|
||||
#define access_ok2(addr, size) batadv_access_ok(VERIFY_WRITE, (addr), (size))
|
||||
#define access_ok3(type, addr, size) batadv_access_ok((type), (addr), (size))
|
||||
|
||||
#endif /* < KERNEL_VERSION(5, 0, 0) */
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)
|
||||
|
||||
#ifndef fallthrough
|
||||
#if __GNUC__ > 7 && !defined(__CHECKER__)
|
||||
# define fallthrough __attribute__((__fallthrough__))
|
||||
#else
|
||||
# define fallthrough do {} while (0) /* fallthrough */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* < KERNEL_VERSION(5, 4, 0) */
|
||||
|
||||
#if LINUX_VERSION_IS_LESS(5, 10, 0)
|
||||
|
||||
#include <linux/if_bridge.h>
|
||||
|
|
Loading…
Reference in a new issue