2021-07-27 18:28:58 +00:00
|
|
|
--- a/src/ap/ap_config.h
|
|
|
|
+++ b/src/ap/ap_config.h
|
2022-08-19 00:17:22 +00:00
|
|
|
@@ -284,6 +284,7 @@ struct hostapd_bss_config {
|
2021-07-27 18:28:58 +00:00
|
|
|
char iface[IFNAMSIZ + 1];
|
|
|
|
char bridge[IFNAMSIZ + 1];
|
|
|
|
char ft_iface[IFNAMSIZ + 1];
|
|
|
|
+ char snoop_iface[IFNAMSIZ + 1];
|
|
|
|
char vlan_bridge[IFNAMSIZ + 1];
|
|
|
|
char wds_bridge[IFNAMSIZ + 1];
|
|
|
|
|
|
|
|
--- a/src/ap/x_snoop.c
|
|
|
|
+++ b/src/ap/x_snoop.c
|
2022-08-19 00:17:22 +00:00
|
|
|
@@ -33,14 +33,16 @@ int x_snoop_init(struct hostapd_data *ha
|
|
|
|
|
|
|
|
hapd->x_snoop_initialized = true;
|
2021-09-01 17:12:27 +00:00
|
|
|
|
|
|
|
- if (hostapd_drv_br_port_set_attr(hapd, DRV_BR_PORT_ATTR_HAIRPIN_MODE,
|
|
|
|
+ if (!conf->snoop_iface[0] &&
|
|
|
|
+ hostapd_drv_br_port_set_attr(hapd, DRV_BR_PORT_ATTR_HAIRPIN_MODE,
|
|
|
|
1)) {
|
|
|
|
wpa_printf(MSG_DEBUG,
|
|
|
|
"x_snoop: Failed to enable hairpin_mode on the bridge port");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
- if (hostapd_drv_br_port_set_attr(hapd, DRV_BR_PORT_ATTR_PROXYARP, 1)) {
|
|
|
|
+ if (!conf->snoop_iface[0] &&
|
|
|
|
+ hostapd_drv_br_port_set_attr(hapd, DRV_BR_PORT_ATTR_PROXYARP, 1)) {
|
|
|
|
wpa_printf(MSG_DEBUG,
|
|
|
|
"x_snoop: Failed to enable proxyarp on the bridge port");
|
|
|
|
return -1;
|
2022-08-19 00:17:22 +00:00
|
|
|
@@ -54,7 +56,8 @@ int x_snoop_init(struct hostapd_data *ha
|
2021-09-01 17:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef CONFIG_IPV6
|
|
|
|
- if (hostapd_drv_br_set_net_param(hapd, DRV_BR_MULTICAST_SNOOPING, 1)) {
|
|
|
|
+ if (!conf->snoop_iface[0] &&
|
|
|
|
+ hostapd_drv_br_set_net_param(hapd, DRV_BR_MULTICAST_SNOOPING, 1)) {
|
|
|
|
wpa_printf(MSG_DEBUG,
|
|
|
|
"x_snoop: Failed to enable multicast snooping on the bridge");
|
|
|
|
return -1;
|
2022-08-19 00:17:22 +00:00
|
|
|
@@ -73,8 +76,12 @@ x_snoop_get_l2_packet(struct hostapd_dat
|
2021-07-27 18:28:58 +00:00
|
|
|
{
|
|
|
|
struct hostapd_bss_config *conf = hapd->conf;
|
|
|
|
struct l2_packet_data *l2;
|
|
|
|
+ const char *ifname = conf->bridge;
|
2021-07-28 10:08:47 +00:00
|
|
|
|
|
|
|
- l2 = l2_packet_init(conf->bridge, NULL, ETH_P_ALL, handler, hapd, 1);
|
2021-07-27 18:28:58 +00:00
|
|
|
+ if (conf->snoop_iface[0])
|
|
|
|
+ ifname = conf->snoop_iface;
|
2021-07-28 10:08:47 +00:00
|
|
|
+
|
|
|
|
+ l2 = l2_packet_init(ifname, NULL, ETH_P_ALL, handler, hapd, 1);
|
2021-07-27 18:28:58 +00:00
|
|
|
if (l2 == NULL) {
|
2021-07-28 10:08:47 +00:00
|
|
|
wpa_printf(MSG_DEBUG,
|
|
|
|
"x_snoop: Failed to initialize L2 packet processing %s",
|
2021-07-27 18:28:58 +00:00
|
|
|
--- a/hostapd/config_file.c
|
|
|
|
+++ b/hostapd/config_file.c
|
2022-08-19 00:17:22 +00:00
|
|
|
@@ -2318,6 +2318,8 @@ static int hostapd_config_fill(struct ho
|
2021-07-27 18:28:58 +00:00
|
|
|
os_strlcpy(bss->bridge, pos, sizeof(bss->bridge));
|
2021-10-21 10:37:09 +00:00
|
|
|
if (!bss->wds_bridge[0])
|
|
|
|
os_strlcpy(bss->wds_bridge, pos, sizeof(bss->wds_bridge));
|
2021-07-27 18:28:58 +00:00
|
|
|
+ } else if (os_strcmp(buf, "snoop_iface") == 0) {
|
|
|
|
+ os_strlcpy(bss->snoop_iface, pos, sizeof(bss->snoop_iface));
|
|
|
|
} 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) {
|