diff options
author | Fernando Fernandez Mancera <ffmancera@riseup.net> | 2024-03-26 12:53:27 +0100 |
---|---|---|
committer | Fernando Fernandez Mancera <ffmancera@riseup.net> | 2024-04-02 15:59:43 +0200 |
commit | 9ac1d6e22bfac7f576dec034a26ac7c9012e5b80 (patch) | |
tree | ea312f560a227545c82fa7779cee9248dc21a2cb | |
parent | 28565cdd3222075954a0c7ef0e1cb3d5f510b8fd (diff) |
libnm-lldp: use ETH_P_ALL instead of NM_ETHERTYPE_LLDP for the socketff/lldp_ovs
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
-rw-r--r-- | src/libnm-lldp/nm-lldp-network.c | 2 |
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; |