From 4a539abdbdb425d0527eff396a4d4bf3951a6b51 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 7 Jan 2016 00:24:10 +0200 Subject: [PATCH] l2_packet: Improve bridge workaround RX processing It was possible for the packet socket on the bridge interface to receive own transmitted frames between the bridge and non-bridge sockets receiving the same incoming frame from a foreign host. This resulted in the hash checksum validation step failing to notice a duplicate RX due to the own frame updating the store hash value. The own frame did get dropping in RX EAPOL processing, but that was too late to address the issue with duplicate RX. Fix this by dropping own frames already in l2_packet layer before checking and updating the last RX hash value. Signed-off-by: Jouni Malinen --- src/l2_packet/l2_packet_linux.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/l2_packet/l2_packet_linux.c b/src/l2_packet/l2_packet_linux.c index f52f7a23b..a283a512f 100644 --- a/src/l2_packet/l2_packet_linux.c +++ b/src/l2_packet/l2_packet_linux.c @@ -206,6 +206,11 @@ static void l2_packet_receive_br(int sock, void *eloop_ctx, void *sock_ctx) wpa_printf(MSG_DEBUG, "%s: src=" MACSTR " len=%d", __func__, MAC2STR(ll.sll_addr), (int) res); + if (os_memcmp(ll.sll_addr, l2->own_addr, ETH_ALEN) == 0) { + wpa_printf(MSG_DEBUG, "%s: Drop RX of own frame", __func__); + return; + } + addr[0] = buf; len[0] = res; sha1_vector(1, addr, len, hash);