From patchwork Fri Sep 14 13:12:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 183919 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id D34672C0085 for ; Fri, 14 Sep 2012 23:13:18 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id A023217C033; Fri, 14 Sep 2012 09:13:02 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Aol0Gax6Wzhr; Fri, 14 Sep 2012 09:13:02 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 6EA2217C017; Fri, 14 Sep 2012 09:12:44 -0400 (EDT) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 9F5DD17C00F for ; Fri, 14 Sep 2012 09:12:42 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4ZwfXdNzluYc for ; Fri, 14 Sep 2012 09:12:38 -0400 (EDT) Received: from nbd.name (nbd.name [46.4.11.11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id 195729D0C5 for ; Fri, 14 Sep 2012 09:12:33 -0400 (EDT) Received: by nf.local (Postfix, from userid 501) id 130327BB962; Fri, 14 Sep 2012 15:12:29 +0200 (CEST) From: Felix Fietkau To: hostap@lists.shmoo.com Subject: [PATCH 1/5] hostapd: fix WDS VLAN bridge handling Date: Fri, 14 Sep 2012 15:12:25 +0200 Message-Id: <1347628349-34362-1-git-send-email-nbd@openwrt.org> X-Mailer: git-send-email 1.7.9.6 (Apple Git-31.1) X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com This patch fixes an issue where removing a WDS VLAN interface also removed the main AP interface from the same bridge. Signed-hostap: Felix Fietkau --- src/drivers/driver_nl80211.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 1117d06..6779877 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -7698,6 +7698,10 @@ static int i802_set_wds_sta(void *priv, const u8 *addr, int aid, int val, } return i802_set_sta_vlan(priv, addr, name, 0); } else { + if (bridge_ifname) + linux_br_del_if(drv->global->ioctl_sock, bridge_ifname, + name); + i802_set_sta_vlan(priv, addr, bss->ifname, 0); return wpa_driver_nl80211_if_remove(priv, WPA_IF_AP_VLAN, name); @@ -8065,7 +8069,12 @@ static int wpa_driver_nl80211_if_remove(void *priv, if (ifindex <= 0) return -1; + nl80211_remove_iface(drv, ifindex); + #ifdef HOSTAPD + if (type != WPA_IF_AP_BSS) + return 0; + if (bss->added_if_into_bridge) { if (linux_br_del_if(drv->global->ioctl_sock, bss->brname, bss->ifname) < 0) @@ -8079,13 +8088,6 @@ static int wpa_driver_nl80211_if_remove(void *priv, "bridge %s: %s", bss->brname, strerror(errno)); } -#endif /* HOSTAPD */ - - nl80211_remove_iface(drv, ifindex); - -#ifdef HOSTAPD - if (type != WPA_IF_AP_BSS) - return 0; if (bss != &drv->first_bss) { struct i802_bss *tbss;