From patchwork Sat May 28 12:38:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 16305 X-Patchwork-Delegate: mareklindner@neomailbox.ch Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id E7B8481813; Sat, 28 May 2016 14:38:41 +0200 (CEST) Authentication-Results: open-mesh.org; dmarc=none header.from=narfation.org Authentication-Results: open-mesh.org; dkim=fail reason="verification failed; unprotected key" header.d=narfation.org header.i=@narfation.org header.b=xXuiNidD; dkim-adsp=fail (unprotected policy); dkim-atps=neutral Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=79.140.41.39; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver=b.a.t.m.a.n@lists.open-mesh.org Authentication-Results: open-mesh.org; dmarc=pass header.from=narfation.org Received: from v3-1039.vlinux.de (narfation.org [79.140.41.39]) by open-mesh.org (Postfix) with ESMTPS id 706E681812 for ; Sat, 28 May 2016 14:38:39 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p200300C593C3F1F90000000000002E16.dip0.t-ipconnect.de [IPv6:2003:c5:93c3:f1f9::2e16]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id 91B6D1C8001; Sat, 28 May 2016 14:38:38 +0200 (CEST) Authentication-Results: v3-1039.vlinux.de; dmarc=none header.from=narfation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1464439118; bh=RZlNRqlDOzTwn+3LgtLDoFbvK//tQCGe0fvOIDvgycg=; h=From:To:Cc:Subject:Date:From; b=xXuiNidDRaCGWFQ0XiomGCq7cssgHMqDJU3+Cp2Xpf49WuGd0vim6RKJDSCtRJdBf 7hjTFhxEFmnO1O4rm+drJ8pHp0W4HbCjTKWHHL9XcexhQvWFOWTc9RUzz9nr+eDErz z47bmRsomBIMEsivHiZ1PB+MbvRorLNF55yFS7Ak= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Sat, 28 May 2016 14:38:26 +0200 Message-Id: <1464439110-3113-1-git-send-email-sven@narfation.org> X-Mailer: git-send-email 2.8.1 Cc: Antonio Quartulli Subject: [B.A.T.M.A.N.] [PATCH 1/5] batman-adv: Clean up untagged vlan when destroying via rtnl-link X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" 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 Cc: Antonio Quartulli Acked-by: Antonio Quartulli --- 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); }