batman-adv: add patches from 2016.4-maint 2017-01-04
authorSven Eckelmann <sven.eckelmann@open-mesh.com>
Mon, 30 Jan 2017 13:37:37 +0000 (14:37 +0100)
committerSven Eckelmann <sven.eckelmann@open-mesh.com>
Mon, 30 Jan 2017 13:40:47 +0000 (14:40 +0100)
 * batman-adv: Decrease hardif refcnt on fragmentation send error

Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
batman-adv/Makefile
batman-adv/patches/0002-batman-adv-Decrease-hardif-refcnt-on-fragmentation-s.patch [new file with mode: 0644]

index 59d1e6e90e68c83fd8065154a71275e5c8328f62..b33f36897aaa93649436c58a65093aa5d458adbf 100644 (file)
@@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=batman-adv
 
 PKG_VERSION:=2016.5
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_MD5SUM:=6717a933a08dd2a01b00df30cb9f16a8
 PKG_HASH:=d0a0fc90c4f410b57d043215e253bb0b855efa5edbe165d87c17bfdcfafd0db7
 
diff --git a/batman-adv/patches/0002-batman-adv-Decrease-hardif-refcnt-on-fragmentation-s.patch b/batman-adv/patches/0002-batman-adv-Decrease-hardif-refcnt-on-fragmentation-s.patch
new file mode 100644 (file)
index 0000000..92da394
--- /dev/null
@@ -0,0 +1,63 @@
+From: Sven Eckelmann <sven@narfation.org>
+Date: Tue, 27 Dec 2016 08:51:17 +0100
+Subject: [PATCH] batman-adv: Decrease hardif refcnt on fragmentation send error
+
+An error before the hardif is found has to free the skb. But every error
+after that has to free the skb + put the hard interface.
+
+Fixes: 8b4132b1447a ("batman-adv: Consume skb in batadv_frag_send_packet")
+Signed-off-by: Sven Eckelmann <sven@narfation.org>
+Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
+---
+ net/batman-adv/fragmentation.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c
+index 9c561e6..0854ebd 100644
+--- a/net/batman-adv/fragmentation.c
++++ b/net/batman-adv/fragmentation.c
+@@ -474,7 +474,7 @@ int batadv_frag_send_packet(struct sk_buff *skb,
+       primary_if = batadv_primary_if_get_selected(bat_priv);
+       if (!primary_if) {
+               ret = -EINVAL;
+-              goto put_primary_if;
++              goto free_skb;
+       }
+       /* Create one header to be copied to all fragments */
+@@ -502,7 +502,7 @@ int batadv_frag_send_packet(struct sk_buff *skb,
+               skb_fragment = batadv_frag_create(skb, &frag_header, mtu);
+               if (!skb_fragment) {
+                       ret = -ENOMEM;
+-                      goto free_skb;
++                      goto put_primary_if;
+               }
+               batadv_inc_counter(bat_priv, BATADV_CNT_FRAG_TX);
+@@ -511,7 +511,7 @@ int batadv_frag_send_packet(struct sk_buff *skb,
+               ret = batadv_send_unicast_skb(skb_fragment, neigh_node);
+               if (ret != NET_XMIT_SUCCESS) {
+                       ret = NET_XMIT_DROP;
+-                      goto free_skb;
++                      goto put_primary_if;
+               }
+               frag_header.no++;
+@@ -519,7 +519,7 @@ int batadv_frag_send_packet(struct sk_buff *skb,
+               /* The initial check in this function should cover this case */
+               if (frag_header.no == BATADV_FRAG_MAX_FRAGMENTS - 1) {
+                       ret = -EINVAL;
+-                      goto free_skb;
++                      goto put_primary_if;
+               }
+       }
+@@ -527,7 +527,7 @@ int batadv_frag_send_packet(struct sk_buff *skb,
+       if (batadv_skb_head_push(skb, header_size) < 0 ||
+           pskb_expand_head(skb, header_size + ETH_HLEN, 0, GFP_ATOMIC) < 0) {
+               ret = -ENOMEM;
+-              goto free_skb;
++              goto put_primary_if;
+       }
+       memcpy(skb->data, &frag_header, header_size);