2021-07-27 18:28:58 +00:00
|
|
|
--- a/src/ap/ap_config.h
|
|
|
|
+++ b/src/ap/ap_config.h
|
|
|
|
@@ -278,6 +278,7 @@ struct hostapd_bss_config {
|
|
|
|
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
|
2021-07-28 10:08:47 +00:00
|
|
|
@@ -71,8 +71,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
|
|
|
|
@@ -2357,6 +2357,8 @@ static int hostapd_config_fill(struct ho
|
|
|
|
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, "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) {
|