public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Antonio Quartulli <a@unstable.cc>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org,
	Antonio Quartulli <a@unstable.cc>,
	Marek Lindner <mareklindner@neomailbox.ch>
Subject: [B.A.T.M.A.N.] [PATCH 5/5] batman-adv: Fix broadcast/ogm queue limit on a removed interface
Date: Tue, 26 Apr 2016 11:27:19 +0800	[thread overview]
Message-ID: <1461641239-7097-6-git-send-email-a@unstable.cc> (raw)
In-Reply-To: <1461641239-7097-1-git-send-email-a@unstable.cc>

From: Linus Lüssing <linus.luessing@c0d3.blue>

When removing a single interface while a broadcast or ogm packet is
still pending then we will free the forward packet without releasing the
queue slots again.

This patch is supposed to fix this issue.

Fixes: 6d5808d4ae1b ("batman-adv: Add missing hardif_free_ref in forw_packet_free")
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
[sven@narfation.org: fix conflicts with current version]
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
---
 net/batman-adv/send.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c
index 3ce06e0a91b1..76417850d3fc 100644
--- a/net/batman-adv/send.c
+++ b/net/batman-adv/send.c
@@ -675,6 +675,9 @@ batadv_purge_outstanding_packets(struct batadv_priv *bat_priv,
 
 		if (pending) {
 			hlist_del(&forw_packet->list);
+			if (!forw_packet->own)
+				atomic_inc(&bat_priv->bcast_queue_left);
+
 			batadv_forw_packet_free(forw_packet);
 		}
 	}
@@ -702,6 +705,9 @@ batadv_purge_outstanding_packets(struct batadv_priv *bat_priv,
 
 		if (pending) {
 			hlist_del(&forw_packet->list);
+			if (!forw_packet->own)
+				atomic_inc(&bat_priv->batman_queue_left);
+
 			batadv_forw_packet_free(forw_packet);
 		}
 	}
-- 
2.8.1


  parent reply	other threads:[~2016-04-26  3:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-26  3:27 [B.A.T.M.A.N.] pull request [net]: batman-adv-0160426 Antonio Quartulli
2016-04-26  3:27 ` [B.A.T.M.A.N.] [PATCH 1/5] batman-adv: Check skb size before using encapsulated ETH+VLAN header Antonio Quartulli
2016-04-26  3:27 ` [B.A.T.M.A.N.] [PATCH 2/5] batman-adv: init neigh node last seen field Antonio Quartulli
2016-04-26  3:27 ` [B.A.T.M.A.N.] [PATCH 3/5] batman-adv: Deactivate TO_BE_ACTIVATED hardif on shutdown Antonio Quartulli
2016-04-26  3:27 ` [B.A.T.M.A.N.] [PATCH 4/5] batman-adv: Reduce refcnt of removed router when updating route Antonio Quartulli
2016-04-26 14:42   ` Sergei Shtylyov
2016-04-26 15:00     ` Sven Eckelmann
2016-04-26  3:27 ` Antonio Quartulli [this message]
2016-04-28 20:43 ` [B.A.T.M.A.N.] pull request [net]: batman-adv-0160426 David Miller
2016-04-28 23:58   ` Antonio Quartulli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461641239-7097-6-git-send-email-a@unstable.cc \
    --to=a@unstable.cc \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=davem@davemloft.net \
    --cc=mareklindner@neomailbox.ch \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox