B.A.T.M.A.N Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH 1/5] batman-adv: Clean up untagged vlan when destroying via rtnl-link
@ 2016-05-28 12:38 Sven Eckelmann
  2016-05-28 12:38 ` [B.A.T.M.A.N.] [PATCH 2/5] batman-adv: Define module rtnl link name Sven Eckelmann
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Sven Eckelmann @ 2016-05-28 12:38 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Antonio Quartulli

The untagged vlan object is only destroyed when the interface is removed
via the legacy sysfs interface. But it also has to be destroyed when the
standard rtnl-link interface is used.

Fixes: 952cebb57518 ("batman-adv: add per VLAN interface attribute framework")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Cc: Antonio Quartulli <a@unstable.cc>
---
 net/batman-adv/soft-interface.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 18b6d07..7527c06 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -1040,7 +1040,9 @@ void batadv_softif_destroy_sysfs(struct net_device *soft_iface)
 static void batadv_softif_destroy_netlink(struct net_device *soft_iface,
 					  struct list_head *head)
 {
+	struct batadv_priv *bat_priv = netdev_priv(soft_iface);
 	struct batadv_hard_iface *hard_iface;
+	struct batadv_softif_vlan *vlan;
 
 	list_for_each_entry(hard_iface, &batadv_hardif_list, list) {
 		if (hard_iface->soft_iface == soft_iface)
@@ -1048,6 +1050,13 @@ static void batadv_softif_destroy_netlink(struct net_device *soft_iface,
 							BATADV_IF_CLEANUP_KEEP);
 	}
 
+	/* destroy the "untagged" VLAN */
+	vlan = batadv_softif_vlan_get(bat_priv, BATADV_NO_FLAGS);
+	if (vlan) {
+		batadv_softif_destroy_vlan(bat_priv, vlan);
+		batadv_softif_vlan_put(vlan);
+	}
+
 	batadv_sysfs_del_meshif(soft_iface);
 	unregister_netdevice_queue(soft_iface, head);
 }
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-06-06 15:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-28 12:38 [B.A.T.M.A.N.] [PATCH 1/5] batman-adv: Clean up untagged vlan when destroying via rtnl-link Sven Eckelmann
2016-05-28 12:38 ` [B.A.T.M.A.N.] [PATCH 2/5] batman-adv: Define module rtnl link name Sven Eckelmann
2016-05-28 12:38 ` [B.A.T.M.A.N.] [PATCH 3/5] batman-adv: Use rtnl link in device creation example Sven Eckelmann
2016-05-28 12:38 ` [B.A.T.M.A.N.] [PATCH 4/5] batman-adv: Modify mesh_iface outside sysfs context Sven Eckelmann
2016-05-28 12:38 ` [B.A.T.M.A.N.] [PATCH 5/5] batman-adv: Revert "postpone sysfs removal when unregistering" Sven Eckelmann
2016-05-29 12:50 ` [B.A.T.M.A.N.] [PATCH 6/6] batman-adv: Avoid sysfs name collision for netns moves Sven Eckelmann
2016-06-06 15:44 ` [B.A.T.M.A.N.] [PATCH 1/5] batman-adv: Clean up untagged vlan when destroying via rtnl-link Antonio Quartulli
2016-06-06 15:46   ` Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox