batman-adv: 2014.0.0 compat updates for older kernels
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
This commit is contained in:
parent
9666bb6860
commit
46ea4de211
1 changed files with 49 additions and 0 deletions
|
@ -0,0 +1,49 @@
|
||||||
|
From f9170f22998a276e04b4c7d91da4c373609d28b3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@web.de>
|
||||||
|
Date: Sun, 19 Jan 2014 22:22:45 +0100
|
||||||
|
Subject: [PATCH] batman-adv: use vlan_/eth_hdr() instead of skb->data in
|
||||||
|
interface_tx path
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Our .ndo_start_xmit handler (batadv_interface_tx()) can rely on having
|
||||||
|
the skb mac header pointer set correctly since the following commit
|
||||||
|
present in kernels >= 3.9:
|
||||||
|
|
||||||
|
"net: reset mac header in dev_start_xmit()" (6d1ccff627)
|
||||||
|
|
||||||
|
Therefore we can safely use eth_hdr() and vlan_eth_hdr() instead of
|
||||||
|
skb->data now, which spares us some ugly type casts.
|
||||||
|
|
||||||
|
Signed-off-by: Linus Lüssing <linus.luessing@web.de>
|
||||||
|
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
|
||||||
|
---
|
||||||
|
compat.h | 11 +++++++++++
|
||||||
|
1 file changed, 11 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/compat.h b/compat.h
|
||||||
|
index 57c9d96..9692ed2 100644
|
||||||
|
--- a/compat.h
|
||||||
|
+++ b/compat.h
|
||||||
|
@@ -302,6 +302,17 @@ static int batadv_interface_set_mac_addr(struct net_device *dev, void *p) \
|
||||||
|
}\
|
||||||
|
static int __batadv_interface_set_mac_addr(x, y)
|
||||||
|
|
||||||
|
+#define batadv_interface_tx(x, y) \
|
||||||
|
+__batadv_interface_tx(struct sk_buff *skb, struct net_device *soft_iface); \
|
||||||
|
+static int batadv_interface_tx(struct sk_buff *skb, \
|
||||||
|
+ struct net_device *soft_iface) \
|
||||||
|
+{ \
|
||||||
|
+ skb_reset_mac_header(skb); \
|
||||||
|
+ return __batadv_interface_tx(skb, soft_iface); \
|
||||||
|
+} \
|
||||||
|
+static int __batadv_interface_tx(struct sk_buff *skb, \
|
||||||
|
+ struct net_device *soft_iface)
|
||||||
|
+
|
||||||
|
#define netdev_master_upper_dev_link netdev_set_master
|
||||||
|
#define netdev_upper_dev_unlink(slave, master) netdev_set_master(slave, NULL)
|
||||||
|
#define netdev_master_upper_dev_get(dev) \
|
||||||
|
--
|
||||||
|
1.8.5.3
|
||||||
|
|
Loading…
Reference in a new issue