From 0e8b0976f5a475126ba3f66aefcb75963fcddccb Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 30 Jan 2017 14:37:37 +0100 Subject: [PATCH] batman-adv: add patches from 2016.4-maint 2017-01-04 * batman-adv: Decrease hardif refcnt on fragmentation send error Signed-off-by: Sven Eckelmann --- batman-adv/Makefile | 2 +- ...ase-hardif-refcnt-on-fragmentation-s.patch | 63 +++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 batman-adv/patches/0002-batman-adv-Decrease-hardif-refcnt-on-fragmentation-s.patch diff --git a/batman-adv/Makefile b/batman-adv/Makefile index 59d1e6e..b33f368 100644 --- a/batman-adv/Makefile +++ b/batman-adv/Makefile @@ -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 index 0000000..92da394 --- /dev/null +++ b/batman-adv/patches/0002-batman-adv-Decrease-hardif-refcnt-on-fragmentation-s.patch @@ -0,0 +1,63 @@ +From: Sven Eckelmann +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 +Signed-off-by: Simon Wunderlich +--- + 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); -- 2.30.2