Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: macvlan: support multicast rx for bridge ports with shared source MAC

Macvlan bridge mode currently does not handle the case where an
external source shares its MAC address with a local macvlan interface.
When such a frame arrives, macvlan_hash_lookup() matches the source
MAC to the local macvlan, and macvlan_multicast_rx() assumes bridge
ports already received the frame during local transmission. Since the
frame actually originated externally, bridge ports never saw it.

This situation arises with protocols like VRRP, where multiple hosts
use the same virtual MAC address.

Support this by passing NULL as the source device and including
MACVLAN_MODE_BRIDGE in the mode mask for the else branch of
macvlan_multicast_rx(). This ensures all VEPA and bridge mode macvlan
interfaces receive incoming multicast regardless of source MAC
matching. The trade-off is that looped-back locally-originated
multicasts may be delivered to bridge ports a second time, but
multicast consumers already handle duplicate frames.

Signed-off-by: Kibaek Yoo <psykibaek@gmail.com>
Link: https://patch.msgid.link/20260228071613.4360-1-psykibaek@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Kibaek Yoo and committed by
Jakub Kicinski
b52363f7 d6ca1995

+8 -4
+8 -4
drivers/net/macvlan.c
··· 313 313 MACVLAN_MODE_BRIDGE); 314 314 else 315 315 /* 316 - * flood only to VEPA ports, bridge ports 317 - * already saw the frame on the way out. 316 + * Flood to VEPA and bridge ports. We cannot distinguish 317 + * a looped-back locally-originated multicast from one 318 + * sent by an external source sharing the same source MAC 319 + * (e.g., VRRP virtual MAC), so deliver to bridge ports 320 + * as well to ensure correct reception in all cases. 318 321 */ 319 - macvlan_broadcast(skb, port, src->dev, 320 - MACVLAN_MODE_VEPA); 322 + macvlan_broadcast(skb, port, NULL, 323 + MACVLAN_MODE_VEPA | 324 + MACVLAN_MODE_BRIDGE); 321 325 } 322 326 323 327 static void macvlan_process_broadcast(struct work_struct *w)