Skip to content

libnm-lldp: use ETH_P_ALL instead of NM_ETHERTYPE_LLDP for the socket

Fernando Fernández Mancera requested to merge ff/lldp_ovs into main

Summary

    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.

Fixes: https://issues.redhat.com/browse/RHEL-1418

Purpose

This is fixing the usage of LLDP when the interface is set as OVS bridge port.

Checklist

Please read https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/main/CONTRIBUTING.md before opening the merge request. In particular, check that:

  • the subject for all commits is concise and explicative
  • the message for all commits explains the reason for the change
  • the source is properly formatted
  • any relevant documentation is up to date
  • you have added unit tests if applicable (not unit, but integration!)
  • the NEWS file is updated when the change deserves to be mentioned, for example for new features, behavior changes, API deprecations, etc.

Merge request reports