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 39b53405..5628ec5b 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);