aboutsummaryrefslogtreecommitdiffstats
path: root/src/l2_packet/l2_packet.h
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-01-31 15:21:58 (GMT)
committerJouni Malinen <j@w1.fi>2015-01-31 15:21:58 (GMT)
commite6dd8196e5daf39e4204ef8ecd26dd50fdca6040 (patch)
tree0454d052b49174120cccd83b9d1783863152cd6e /src/l2_packet/l2_packet.h
parentdb5f6b2ca3123beff63c487c28ff594061fdd71e (diff)
downloadhostap-e6dd8196e5daf39e4204ef8ecd26dd50fdca6040.zip
hostap-e6dd8196e5daf39e4204ef8ecd26dd50fdca6040.tar.gz
hostap-e6dd8196e5daf39e4204ef8ecd26dd50fdca6040.tar.bz2
Work around Linux packet socket regression
Linux kernel commit 576eb62598f10c8c7fd75703fe89010cdcfff596 ('bridge: respect RFC2863 operational state') from 2012 introduced a regression for using wpa_supplicant with EAPOL frames and a station interface in a bridge. Since it does not look like this regression is going to get fixed any time soon (it is already two years from that commit and over 1.5 from a discussion pointing out the regression), add a workaround in wpa_supplicant to avoid this issue. The wpa_supplicant workaround uses a secondary packet socket to capture all frames (ETH_P_ALL) from the netdev that is in a bridge. This is needed to avoid the kernel regression. However, this comes at the price of more CPU load. Some of this is avoided with use of Linux socket filter, but still, this is less efficient than a packet socket bound to the specific EAPOL ethertype. The workaround gets disabled automatically, if the main packet socket interface on the bridge interface turns out to be working for RX (e.g., due to an old kernel version being used or a new kernel version having a fix for the regression). In addition, this workaround is only taken into use for the special case of running wpa_supplicant with an interface in a bridge. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/l2_packet/l2_packet.h')
-rw-r--r--src/l2_packet/l2_packet.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/l2_packet/l2_packet.h b/src/l2_packet/l2_packet.h
index 7537f93..2a45245 100644
--- a/src/l2_packet/l2_packet.h
+++ b/src/l2_packet/l2_packet.h
@@ -68,6 +68,19 @@ struct l2_packet_data * l2_packet_init(
void *rx_callback_ctx, int l2_hdr);
/**
+ * l2_packet_init_bridge - Like l2_packet_init() but with bridge workaround
+ *
+ * This version of l2_packet_init() can be used to enable a workaround for Linux
+ * packet socket in case of a station interface in a bridge.
+ */
+struct l2_packet_data * l2_packet_init_bridge(
+ const char *br_ifname, const char *ifname, const u8 *own_addr,
+ unsigned short protocol,
+ void (*rx_callback)(void *ctx, const u8 *src_addr,
+ const u8 *buf, size_t len),
+ void *rx_callback_ctx, int l2_hdr);
+
+/**
* l2_packet_deinit - Deinitialize l2_packet interface
* @l2: Pointer to internal l2_packet data from l2_packet_init()
*/