From 46ea4de21174329c5abacf1ca2476bbc2d30549a Mon Sep 17 00:00:00 2001 From: Marek Lindner Date: Thu, 30 Jan 2014 20:44:46 +0800 Subject: [PATCH] batman-adv: 2014.0.0 compat updates for older kernels Signed-off-by: Marek Lindner --- ...lan_-eth_hdr-instead-of-skb-data-in-.patch | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 batman-adv/patches/0007-batman-adv-use-vlan_-eth_hdr-instead-of-skb-data-in-.patch diff --git a/batman-adv/patches/0007-batman-adv-use-vlan_-eth_hdr-instead-of-skb-data-in-.patch b/batman-adv/patches/0007-batman-adv-use-vlan_-eth_hdr-instead-of-skb-data-in-.patch new file mode 100644 index 0000000..56fee68 --- /dev/null +++ b/batman-adv/patches/0007-batman-adv-use-vlan_-eth_hdr-instead-of-skb-data-in-.patch @@ -0,0 +1,49 @@ +From f9170f22998a276e04b4c7d91da4c373609d28b3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Linus=20L=C3=BCssing?= +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 +Signed-off-by: Marek Lindner +--- + 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 + -- 2.30.2