From 24c0a957343f0e323428a2b0d6ca3235d62a9bd2 Mon Sep 17 00:00:00 2001 From: DrDoof <8052722+DrDoof@users.noreply.github.com> Date: Sat, 10 Oct 2026 02:43:04 +0200 Subject: [PATCH] igmp: stop looking up IPv4 multicast in the L2 table on igmp off igmp_setup(), which `igmp off` also calls, enabled the lookup of IPv4 multicast in the L2 table. Groups learned while IGMP was on therefore kept going only to the ports that had reported them, and with reports no longer trapped nothing updated those entries until a reboot. The lookup is now enabled in igmp_enable() and disabled in igmp_setup(), so with IGMP off all IP multicast is flooded again. --- doc/igmp.md | 3 ++- rtl837x_igmp.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/igmp.md b/doc/igmp.md index 1584287f..adce94f2 100644 --- a/doc/igmp.md +++ b/doc/igmp.md @@ -73,7 +73,8 @@ uint8_t igmp_packet_handler(void) __banked; void igmp_show(void) __banked; ```c `igmp_setup()` is called at boot-time and configures flooding of all IP-MC packets by -default, as otherwise no IP-MC would be possible in the network. +default, as otherwise no IP-MC would be possible in the network. `igmp off` calls it as +well; groups learned while IGMP was on stay in the table, but are no longer looked up. `igmp_enable()`starts IGMP which cause IGMP packets to be handled by the CPU and forwarding of IP-MC packets to be limited to only subscribed ports. diff --git a/rtl837x_igmp.c b/rtl837x_igmp.c index 3ef2b2ec..69cd8568 100644 --- a/rtl837x_igmp.c +++ b/rtl837x_igmp.c @@ -107,8 +107,7 @@ void igmp_setup(void) __banked REG_SET(RTL837X_IPV4_UNKN_MC_FLD_PMSK, mask); REG_SET(RTL837X_IPV6_UNKN_MC_FLD_PMSK, mask); - // Enable lookup of IPv4 MC addresses in table - reg_bit_set(RTL837X_L2_CTRL, L2_CTRL_LUT_IPMC_HASH); + reg_bit_clear(RTL837X_L2_CTRL, L2_CTRL_LUT_IPMC_HASH); /* Configure per-port IGMP operations when protocol messages are received * bits 0-9 enable MC protocol snooping @@ -145,6 +144,8 @@ void igmp_enable(void) __banked { print_string("igmp_enable called\n"); igmpEnabled = 1; + // Enable lookup of IPv4 MC addresses in table + reg_bit_set(RTL837X_L2_CTRL, L2_CTRL_LUT_IPMC_HASH); // Configure trapping of unhandled IGMP protocol packets to CPU REG_SET(RTL837X_IGMP_TRAP_CFG, IGMP_CPU_PORT | IGMP_TRAP_PRIORITY);