AP: Add some bridge port attribute settings
"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>
This commit is contained in:
parent
f628e6b30e
commit
eb146ee804
5 changed files with 25 additions and 0 deletions
|
@ -2316,6 +2316,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
|
||||||
sizeof(conf->bss[0]->iface));
|
sizeof(conf->bss[0]->iface));
|
||||||
} else if (os_strcmp(buf, "bridge") == 0) {
|
} else if (os_strcmp(buf, "bridge") == 0) {
|
||||||
os_strlcpy(bss->bridge, pos, sizeof(bss->bridge));
|
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) {
|
} else if (os_strcmp(buf, "vlan_bridge") == 0) {
|
||||||
os_strlcpy(bss->vlan_bridge, pos, sizeof(bss->vlan_bridge));
|
os_strlcpy(bss->vlan_bridge, pos, sizeof(bss->vlan_bridge));
|
||||||
} else if (os_strcmp(buf, "wds_bridge") == 0) {
|
} else if (os_strcmp(buf, "wds_bridge") == 0) {
|
||||||
|
@ -4467,6 +4469,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
|
||||||
#endif /* CONFIG_FILS */
|
#endif /* CONFIG_FILS */
|
||||||
} else if (os_strcmp(buf, "multicast_to_unicast") == 0) {
|
} else if (os_strcmp(buf, "multicast_to_unicast") == 0) {
|
||||||
bss->multicast_to_unicast = atoi(pos);
|
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) {
|
} else if (os_strcmp(buf, "broadcast_deauth") == 0) {
|
||||||
bss->broadcast_deauth = atoi(pos);
|
bss->broadcast_deauth = atoi(pos);
|
||||||
} else if (os_strcmp(buf, "notify_mgmt_frames") == 0) {
|
} else if (os_strcmp(buf, "notify_mgmt_frames") == 0) {
|
||||||
|
|
|
@ -284,6 +284,7 @@ struct hostapd_bss_config {
|
||||||
char bridge[IFNAMSIZ + 1];
|
char bridge[IFNAMSIZ + 1];
|
||||||
char vlan_bridge[IFNAMSIZ + 1];
|
char vlan_bridge[IFNAMSIZ + 1];
|
||||||
char wds_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;
|
enum hostapd_logger_level logger_syslog_level, logger_stdout_level;
|
||||||
|
|
||||||
|
@ -748,6 +749,7 @@ struct hostapd_bss_config {
|
||||||
#endif /* CONFIG_FILS */
|
#endif /* CONFIG_FILS */
|
||||||
|
|
||||||
int multicast_to_unicast;
|
int multicast_to_unicast;
|
||||||
|
int bridge_multicast_to_unicast;
|
||||||
|
|
||||||
int broadcast_deauth;
|
int broadcast_deauth;
|
||||||
|
|
||||||
|
|
|
@ -1435,6 +1435,22 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (conf->bridge[0]) {
|
||||||
|
/* Set explicitly configured bridge parameters that might have
|
||||||
|
* been lost if the interface has been removed out of the
|
||||||
|
* bridge. */
|
||||||
|
|
||||||
|
/* 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 (conf->proxy_arp) {
|
||||||
if (x_snoop_init(hapd)) {
|
if (x_snoop_init(hapd)) {
|
||||||
wpa_printf(MSG_ERROR,
|
wpa_printf(MSG_ERROR,
|
||||||
|
|
|
@ -2647,6 +2647,7 @@ struct macsec_init_params {
|
||||||
enum drv_br_port_attr {
|
enum drv_br_port_attr {
|
||||||
DRV_BR_PORT_ATTR_PROXYARP,
|
DRV_BR_PORT_ATTR_PROXYARP,
|
||||||
DRV_BR_PORT_ATTR_HAIRPIN_MODE,
|
DRV_BR_PORT_ATTR_HAIRPIN_MODE,
|
||||||
|
DRV_BR_PORT_ATTR_MCAST2UCAST,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum drv_br_net_param {
|
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";
|
return "proxyarp_wifi";
|
||||||
case DRV_BR_PORT_ATTR_HAIRPIN_MODE:
|
case DRV_BR_PORT_ATTR_HAIRPIN_MODE:
|
||||||
return "hairpin_mode";
|
return "hairpin_mode";
|
||||||
|
case DRV_BR_PORT_ATTR_MCAST2UCAST:
|
||||||
|
return "multicast_to_unicast";
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in a new issue