Hoi folks,

I was playing around with af-packet and creating LCP pairs with them.
I noticed a bunch of errors with 'l3 mac mismatch' while multicast worked, unicast did not.

I saw commits 1412d24ba and 3e00a101be but they are innocent, rolling them back in my build would not fix the situation.

I realized that linux-cp has a bug in lcp_interface.c:
- After tap_create_if() on L1064, hw still points to the PHY's HW interface from L841. - The STATUS_L3 flag ends up on the PHY (in my case the AF_PACKET interface), not on tapXXXX. Linux sends unicast with the peer's real MAC, which mismatches the tap's synthetic 02:fe:... mac address and thus gets dropped. Multicast is allowed to bypass DMAC checks, and thus multicast works.

The fix seems simple - look up a new hw from the args.sw_if_index (the TAP) and set the flag on that one. Considering how long we've had Linux CP and no changes around the TAP creation that I could see, am I perhaps misreading this?

https://gerrit.fd.io/r/c/vpp/+/45103 is a fix. Without it, containerlab created eth1/eth2/ethN af-packet interfaces, but the corresponding tap4096/tap4097/tap4098 were not in promiscuous mode. With the gerrit, containerlab works and the TAPs are in promiscuous mode.

Please take a look.

--
Pim van Pelt <[email protected]>
PBVP1-RIPE https://ipng.ch/

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#26867): https://lists.fd.io/g/vpp-dev/message/26867
Mute This Topic: https://lists.fd.io/mt/118163322/21656
Group Owner: [email protected]
Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/14379924/21656/631435203/xyzzy 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to