[PATCH] nl80211: relax bridge setup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Michal Kazior <michal@xxxxxxxxx>

Normally nl80211 driver will attempt to strictly control
what bridge given interface is put in. It'll attempt to
remove it from an existing bridge if it doesn't match the
configured one. If it's not in a bridge it'll try to put it
into one. If any of this fails then hostapd will bail out
and not set up the BSS at all.

Arguably that's reasonable since it allows to set the BSS up
coherently with regard to EAPOL handling as well as allows
extra interactions with things like FDB.

However not all hostapd drivers interact with bridge= the
same way. One example is atheros. Therefore it's not clear
what the desired behavior should be if consistency across
drivers is considered.

There's a case where one might want to use a non-native
linux bridge, eg. openvswitch in which case regular ioctls
won't work to put an interface into a bridge, or figure out
what bridge an interface is in. The underlying wireless
driver can still be ordinary nl80211 driver.

This change relaxes the bridge setup failure so that hostapd
still starts even if it fails to add an interface into a
configured bridge name. It still sets up all the necessary
sockets (including the configured bridge=) so EAPOL handling
should work fine. This then leaves it to the system
integrator to manage wireless interface as bridge ports and
possibly fdb hints too.

Signed-off-by: Michal Kazior <michal@xxxxxxxxx>
---
 src/drivers/driver_nl80211.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 96fd0aadd..77dbf94b5 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -6923,10 +6923,10 @@ static int i802_check_bridge(struct wpa_driver_nl80211_data *drv,
 	wpa_printf(MSG_DEBUG, "nl80211: Adding interface %s into bridge %s",
 		   ifname, brname);
 	if (linux_br_add_if(drv->global->ioctl_sock, brname, ifname) < 0) {
-		wpa_printf(MSG_ERROR, "nl80211: Failed to add interface %s "
+		wpa_printf(MSG_WARNING, "nl80211: Failed to add interface %s "
 			   "into bridge %s: %s",
 			   ifname, brname, strerror(errno));
-		return -1;
+		return 0;
 	}
 	bss->added_if_into_bridge = 1;
 
-- 
2.22.0


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux