From: Dedy Lansky Date: Sun, 28 Feb 2016 13:54:17 +0000 (+0200) Subject: nl80211: Support network hierarchy of a master interface under bridge X-Git-Tag: hostap_2_6~722 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2d6c17aa0f9107a0e8092238b849461447cdd21;p=thirdparty%2Fhostap.git nl80211: Support network hierarchy of a master interface under bridge Since commit cb05808c46539922cf02e9e8527a062e90637ff9 ('nl80211: Generic Linux master interface support for hostapd'), hostapd is listening for EAPOL frames on any master which the interface is enslaved under. This commit allows hostapd to support network hierarchy in which the interface is enslaved under some master which in turn is enslaved under a bridge. Signed-off-by: Dedy Lansky --- diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 570dee662..5fb6652a0 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -5912,6 +5912,14 @@ static void *i802_init(struct hostapd_data *hapd, params->ifname, master_ifname); /* start listening for EAPOL on the master interface */ add_ifidx(drv, if_nametoindex(master_ifname), drv->ifindex); + + /* check if master itself is under bridge */ + if (linux_br_get(master_ifname, master_ifname) == 0) { + wpa_printf(MSG_DEBUG, "nl80211: which is in bridge %s", + master_ifname); + br_ifindex = if_nametoindex(master_ifname); + os_strlcpy(bss->brname, master_ifname, IFNAMSIZ); + } } else { master_ifname[0] = '\0'; }