mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-17 21:00:22 +01:00
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 commit9ac1d6e22b) (cherry picked from commit2fac176986) (cherry picked from commit34b2f89904)
This commit is contained in:
parent
7729b28ef1
commit
b0b5977650
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue