summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFernando Fernandez Mancera <ffmancera@riseup.net>2024-03-26 12:53:27 +0100
committerFernando Fernandez Mancera <ffmancera@riseup.net>2024-04-05 11:57:30 +0200
commit34b2f89904f895743ac6381d5e8c3da3a32532cc (patch)
tree58446af15de67fd5e96de2d80d249383cb4b0dea
parent118579c6de3c3346aa7f0e5b8d8ec09e28df40de (diff)
libnm-lldp: use ETH_P_ALL instead of NM_ETHERTYPE_LLDP for the socket
When creating the socket for listening to LLDP frames we are setting NM_ETHERTYPE_LLDP (0x88cc) as protocol. In most of the cases, that is correct but when the interface is attached as a port to a OVS bridge, kernel is not matching the protocol correctly. The reason might be that some metadata is added to the packet, but we are not completely sure about it. Instead, we should use ETH_P_ALL to match all the protocols. Later, we have a eBPF filter to drop the packet by multicast MAC address or protocol. This is how lldpd is doing it for example. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1903 (cherry picked from commit 9ac1d6e22bfac7f576dec034a26ac7c9012e5b80) (cherry picked from commit 2fac176986f3afaa84242e069613cc543bfcc58c)
-rw-r--r--src/libnm-lldp/nm-lldp-network.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libnm-lldp/nm-lldp-network.c b/src/libnm-lldp/nm-lldp-network.c
index 811c3a7291..28cc745249 100644
--- a/src/libnm-lldp/nm-lldp-network.c
+++ b/src/libnm-lldp/nm-lldp-network.c
@@ -46,7 +46,7 @@ nm_lldp_network_bind_raw_socket(int ifindex)
assert(ifindex > 0);
- fd = socket(AF_PACKET, SOCK_RAW | SOCK_CLOEXEC | SOCK_NONBLOCK, htobe16(NM_ETHERTYPE_LLDP));
+ fd = socket(AF_PACKET, SOCK_RAW | SOCK_CLOEXEC | SOCK_NONBLOCK, htobe16(ETH_P_ALL));
if (fd < 0)
return -errno;