Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EDP_MULTICAST_ADDR in edp.h seems not a multicast address #442

Open
qiuchengxuan opened this issue Apr 13, 2021 · 10 comments
Open

EDP_MULTICAST_ADDR in edp.h seems not a multicast address #442

qiuchengxuan opened this issue Apr 13, 2021 · 10 comments

Comments

@qiuchengxuan
Copy link

Bug description

Lldpd will call SIOCADDMULTI ioctl to add multicast address which is not really a multicast address when EDP enabled.

Steps to reproduce the problem

Platform specific, start LLDPD with edp enabled, some ethernet driver will complain not a multicast address

Expected outcome

lldpd started with no error

Current outcome

After executing the above steps, lldpd crashed. Here is the end of
the output of lldpd -ddddd before the crash:

root@OpenWrt:/# /usr/sbin/lldpd -d -e -M 4
2021-04-13T07:44:46 [WARN/priv] no privilege separation available
2021-04-13T07:44:46 [INFO/main] protocol LLDP enabled
2021-04-13T07:44:46 [INFO/main] protocol CDPv1 disabled
2021-04-13T07:44:46 [[ 2864.327865] cpu 0: ! MAJOR FM-MAC Error [CPU00, drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/memac.c:797 MemacAddHashMacAddress]: Unsupported Operation;
INFO/main] p[ 2864.327870] cpu 0: Unicast Address
rotocol CDPv2 di[ 2864.343723] cpu 0:
sabled
2021-04-[ 2864.352077] FM_MAC_AddHashMacAddr() = 0x00050026
13T07:44:46  2864.358088] fsl_dpa soc:fsl,dpaa:ethernet@1 eth3: mac_dev->set_multi() = -38
34m[INFO/main] protocol SONMP disabled
2021-04-13T07:44:46 [INFO/main] protocol EDP enabled
2021-04-13T07:44:46 [INFO/main] protocol FDP disabled
2021-04-13T07:44:46 [INFO/[ 2864.383794] cpu 0: ! MAJOR FM-MAC Error [CPU00, drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/memac.c:797 MemacAddHashMacAddress]: Unsupported Operation;
event] libev[ 2864.383796] cpu 0: Unicast Address
ent 2.1.11-stabl[ 2864.399525] cpu 0:
e initialized wi[ 2864.407871] FM_MAC_AddHashMacAddr() = 0x00050026
[ 2864.413878] fsl_dpa soc:fsl,dpaa:ethernet@2 eth0: mac_dev->set_multi() = -38

[ 2864.439778] cpu 0: ! MAJOR FM-MAC Error [CPU00, drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/memac.c:797 MemacAddHashMacAddress]: Unsupported Operation;
[ 2864.439781] cpu 0: Unicast Address
[ 2864.454734] cpu 0:
[ 2864.460319] FM_MAC_AddHashMacAddr() = 0x00050026

Additional information

Spotted on version 1.0.3, and still exists in master

@vincentbernat
Copy link
Member

Humm, this was never reported until now and it works as expected in software: Linux does not really care that the MAC address is multicast or not and the NIC is listening to this MAC address as a result of the registration. On Linux, it is possible to add more MAC addresses through Netlink with recent kernels. And I need to find the equivalent for other OS.

@vincentbernat
Copy link
Member

If the main problem is only the crash, can you provide a coredump?

@qiuchengxuan
Copy link
Author

It doesn't crash, just kernel error

@qiuchengxuan
Copy link
Author

It seems to be NIC driver specific, most driver won't care whether it's a multicast address except FSL DPAA SDK

@vincentbernat
Copy link
Member

Does EDP work?

If not, can you try to use bridge fdb add 00:e0:2b:00:00:00 dev eth0 and see if you are able to receive EDP packets?

@qiuchengxuan
Copy link
Author

I don't know, I encountered this problem simply because it's default enabled in OpenWRT, although I don't think so because I had a glance to driver source which takes no further action but returned error.

@vincentbernat
Copy link
Member

Is EDP enabled by default?

@qiuchengxuan
Copy link
Author

qiuchengxuan commented Apr 14, 2021

@vincentbernat
Copy link
Member

After thinking a bit about it, I have decided to not implement it because:

  • while the ioctl() says "multicast", it does work for unicast across many OS and platforms, it seems that the driver should not refuse to program this address because it is not multicast,
  • registering an unicast address can only be done using Netlink with a fair amount of code and this code will be running as root,
  • EDP/FDP are a protocol from the past, maybe it would be safer for OpenWRT to not enable them by default (a few bugs have been fixed in the parsing code recently).

@qiuchengxuan
Copy link
Author

I see, indeed OpenWRT should not enable this by default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants