[v2,1/2] batman-adv: Fix broadcast/ogm queue limit on a removed interface
Commit Message
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 <linus.luessing@web.de>
---
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.
Comments
On Thursday 18 April 2013 00:08:36 Linus Lüssing wrote:
> 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 <linus.luessing@web.de>
> ---
You are talking a batman-adv interface when it contains multiple slave
interfaces, right? So batadv_purge_outstanding_packets would be called in
batadv_hardif_disable_interface and not in batadv_mesh_free (which is only
done when the batX interface will be removed).
This at least sounds legit and I cannot find where else this imbalance would
be fixed.
Acked-by: Sven Eckelmann <sven@narfation.org>
Kind regards,
Sven
PS: This patch only requires the path change from / to /net/batman-adv/ to
apply via git-am
@@ -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);
}
}