summaryrefslogtreecommitdiff
path: root/batman-adv/src/compat-hacks.h
diff options
context:
space:
mode:
Diffstat (limited to 'batman-adv/src/compat-hacks.h')
-rw-r--r--batman-adv/src/compat-hacks.h57
1 files changed, 14 insertions, 43 deletions
diff --git a/batman-adv/src/compat-hacks.h b/batman-adv/src/compat-hacks.h
index 646e179..fcf7b93 100644
--- a/batman-adv/src/compat-hacks.h
+++ b/batman-adv/src/compat-hacks.h
@@ -5,49 +5,6 @@
#include <linux/version.h> /* LINUX_VERSION_CODE */
#include <linux/types.h>
-#if LINUX_VERSION_IS_LESS(5, 14, 0)
-
-#include <linux/if_bridge.h>
-#include <net/addrconf.h>
-
-#if IS_ENABLED(CONFIG_IPV6)
-static inline bool
-br_multicast_has_router_adjacent(struct net_device *dev, int proto)
-{
- struct list_head bridge_mcast_list = LIST_HEAD_INIT(bridge_mcast_list);
- struct br_ip_list *br_ip_entry, *tmp;
- int ret;
-
- if (proto != ETH_P_IPV6)
- return true;
-
- ret = br_multicast_list_adjacent(dev, &bridge_mcast_list);
- if (ret < 0)
- return true;
-
- ret = false;
-
- list_for_each_entry_safe(br_ip_entry, tmp, &bridge_mcast_list, list) {
- if (br_ip_entry->addr.proto == htons(ETH_P_IPV6) &&
- ipv6_addr_is_ll_all_routers(&br_ip_entry->addr.dst.ip6))
- ret = true;
-
- list_del(&br_ip_entry->list);
- kfree(br_ip_entry);
- }
-
- return ret;
-}
-#else
-static inline bool
-br_multicast_has_router_adjacent(struct net_device *dev, int proto)
-{
- return true;
-}
-#endif
-
-#endif /* LINUX_VERSION_IS_LESS(5, 14, 0) */
-
#if LINUX_VERSION_IS_LESS(6, 0, 0)
#define __vstring(item, fmt, ap) __dynamic_array(char, item, 256)
@@ -71,6 +28,20 @@ static inline u32 batadv_get_random_u32_below(u32 ep_ro)
#endif /* LINUX_VERSION_IS_LESS(6, 2, 0) */
+#if LINUX_VERSION_IS_LESS(6, 4, 0)
+
+#include <linux/if_vlan.h>
+
+/* Prefer this version in TX path, instead of
+ * skb_reset_mac_header() + vlan_eth_hdr()
+ */
+static inline struct vlan_ethhdr *skb_vlan_eth_hdr(const struct sk_buff *skb)
+{
+ return (struct vlan_ethhdr *)skb->data;
+}
+
+#endif /* LINUX_VERSION_IS_LESS(6, 4, 0) */
+
/* <DECLARE_EWMA> */
#include <linux/version.h>