From patchwork Wed Apr 17 22:08:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Linus_L=C3=BCssing?= X-Patchwork-Id: 2921 X-Patchwork-Delegate: mareklindner@neomailbox.ch Return-Path: Received: from mout.web.de (mout.web.de [212.227.17.11]) by open-mesh.org (Postfix) with ESMTP id 4E5EF602001 for ; Thu, 18 Apr 2013 00:08:39 +0200 (CEST) Received: from localhost ([130.225.247.83]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0M5fsK-1UmZGI3SUy-00y6Bh; Thu, 18 Apr 2013 00:08:39 +0200 From: =?UTF-8?q?Linus=20L=C3=BCssing?= To: b.a.t.m.a.n@lists.open-mesh.org Date: Thu, 18 Apr 2013 00:08:36 +0200 Message-Id: <1366236516-14512-1-git-send-email-linus.luessing@web.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1366235673-13763-1-git-send-email-linus.luessing@web.de> References: <1366235673-13763-1-git-send-email-linus.luessing@web.de> MIME-Version: 1.0 X-Provags-ID: V02:K0:zt9jzwL3+BErthUtwNCL0ZhNbWDGgclFCzMOQvO3OJX 1hPeVhJd1QZtJVu6kV+bTPzrLJ8Iii2AoELYtm3f6QS/1q6ure 1lhJwKzofNm15F8D8kIQjfIK2QRjxseIgvFn7ZMQLTJkERCbl1 SnthWlbifOK59wDRs07F7KGT8SYLEmYczIy85Hpkoao2zKC4vt dN96giX7ZAzIYIj4W+3sg== Subject: [B.A.T.M.A.N.] [PATCHv2 1/2] batman-adv: Fix broadcast/ogm queue limit on a removed interface X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 22:08:39 -0000 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. Signed-off-by: Linus Lüssing Acked-by: Sven Eckelmann --- send.c | 6 ++++++ 1 file changed, 6 insertions(+) * v2: Fix summary line of commit message: This issue can happen for both OGMs and broadcast packets. diff --git a/send.c b/send.c index ed7072a..2d539d6 100644 --- a/send.c +++ b/send.c @@ -356,6 +356,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); } } @@ -382,6 +385,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); } }