@@ -2316,6 +2316,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
sizeof(conf->bss[0]->iface));
} else if (os_strcmp(buf, "bridge") == 0) {
os_strlcpy(bss->bridge, pos, sizeof(bss->bridge));
+ } else if (os_strcmp(buf, "bridge_hairpin") == 0) {
+ bss->bridge_hairpin = atoi(pos);
} else if (os_strcmp(buf, "vlan_bridge") == 0) {
os_strlcpy(bss->vlan_bridge, pos, sizeof(bss->vlan_bridge));
} else if (os_strcmp(buf, "wds_bridge") == 0) {
@@ -4467,6 +4469,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
#endif /* CONFIG_FILS */
} else if (os_strcmp(buf, "multicast_to_unicast") == 0) {
bss->multicast_to_unicast = atoi(pos);
+ } else if (os_strcmp(buf, "bridge_multicast_to_unicast") == 0) {
+ bss->bridge_multicast_to_unicast = atoi(pos);
} else if (os_strcmp(buf, "broadcast_deauth") == 0) {
bss->broadcast_deauth = atoi(pos);
} else if (os_strcmp(buf, "notify_mgmt_frames") == 0) {
@@ -284,6 +284,7 @@ struct hostapd_bss_config {
char bridge[IFNAMSIZ + 1];
char vlan_bridge[IFNAMSIZ + 1];
char wds_bridge[IFNAMSIZ + 1];
+ int bridge_hairpin; /* hairpin_mode on bridge members */
enum hostapd_logger_level logger_syslog_level, logger_stdout_level;
@@ -748,6 +749,7 @@ struct hostapd_bss_config {
#endif /* CONFIG_FILS */
int multicast_to_unicast;
+ int bridge_multicast_to_unicast;
int broadcast_deauth;
@@ -1435,6 +1435,18 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first,
return -1;
}
+ if (conf->bridge[0]) {
+ /* multicast to unicast on bridge ports */
+ if (conf->bridge_multicast_to_unicast) {
+ hostapd_drv_br_port_set_attr(hapd, DRV_BR_PORT_ATTR_MCAST2UCAST, 1);
+ }
+
+ /* hairpin mode */
+ if (conf->bridge_hairpin) {
+ hostapd_drv_br_port_set_attr(hapd, DRV_BR_PORT_ATTR_HAIRPIN_MODE, 1);
+ }
+ }
+
if (conf->proxy_arp) {
if (x_snoop_init(hapd)) {
wpa_printf(MSG_ERROR,
@@ -2647,6 +2647,7 @@ struct macsec_init_params {
enum drv_br_port_attr {
DRV_BR_PORT_ATTR_PROXYARP,
DRV_BR_PORT_ATTR_HAIRPIN_MODE,
+ DRV_BR_PORT_ATTR_MCAST2UCAST,
};
enum drv_br_net_param {
@@ -11615,6 +11615,8 @@ static const char * drv_br_port_attr_str(enum drv_br_port_attr attr)
return "proxyarp_wifi";
case DRV_BR_PORT_ATTR_HAIRPIN_MODE:
return "hairpin_mode";
+ case DRV_BR_PORT_ATTR_MCAST2UCAST:
+ return "multicast_to_unicast";
}
return NULL;
"multicast_to_unicast" and "hairpin_mode" are usually set outside of hostapd. However DFS channel change events pull the BSS out of the bridge causing these attributes to be lost. Make these settings tunable within hostapd so they are retained after the BSS is brought up again. Signed-off-by: Anthony Refuerzo <anthony96922@gmail.com> --- hostapd/config_file.c | 4 ++++ src/ap/ap_config.h | 2 ++ src/ap/hostapd.c | 12 ++++++++++++ src/drivers/driver.h | 1 + src/drivers/driver_nl80211.c | 2 ++ 5 files changed, 21 insertions(+)