diff options
| author | David S. Miller <davem@davemloft.net> | 2016-05-10 23:36:14 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2016-05-10 23:36:14 -0400 |
| commit | cf88585b1d5ce49515aabb381812976e2840a967 (patch) | |
| tree | e878f445261d1d28c53660c580d3d6d47aac565e /net/batman-adv/send.c | |
| parent | 953abb3823633385b1235add9c30c3e775dee0bc (diff) | |
| parent | 676970e55b1033af7f0a03d4037b4d9b76327ded (diff) | |
| download | talos-op-linux-cf88585b1d5ce49515aabb381812976e2840a967.tar.gz talos-op-linux-cf88585b1d5ce49515aabb381812976e2840a967.zip | |
Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge
Antonio Quartulli says:
====================
Included changes:
- remove useless skb size check in batadv_interface_rx
- basic netns support introduced by Andrew Lunn:
- prevent virtual interface from changing netns by setting
NETIF_F_NETNS_LOCAL
- create virtual interface within the netns of the first
hard-interface
- introduce detection of complex bridge loops and report event
to the user (via udev) when the Bridge Loop Avoidance mechanism
can't prevent them
- minor reference counting bugfixes for the hard_iface object that
couldn't make it via the net tree
- use kref_get() instead of kref_get_unless_zero() to make reference
counting bug more visible
- use batadv_compare_eth() all over the code when possible instead of
plain memcmp()
- minor code cleanup and style adjustments
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/batman-adv/send.c')
| -rw-r--r-- | net/batman-adv/send.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c index 99ea9001cf8a..f2f125684ed9 100644 --- a/net/batman-adv/send.c +++ b/net/batman-adv/send.c @@ -26,6 +26,7 @@ #include <linux/if.h> #include <linux/jiffies.h> #include <linux/kernel.h> +#include <linux/kref.h> #include <linux/list.h> #include <linux/netdevice.h> #include <linux/printk.h> @@ -577,10 +578,15 @@ static void batadv_send_outstanding_bcast_packet(struct work_struct *work) if (forw_packet->num_packets >= hard_iface->num_bcasts) continue; + if (!kref_get_unless_zero(&hard_iface->refcount)) + continue; + /* send a copy of the saved skb */ skb1 = skb_clone(forw_packet->skb, GFP_ATOMIC); if (skb1) batadv_send_broadcast_skb(skb1, hard_iface); + + batadv_hardif_put(hard_iface); } rcu_read_unlock(); |

