mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
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.
This commit is contained in:
1 parent
e67c928eb7
commit
24c0a95734
2 files changed
+5
-3
No files matched your search
+2
-1
@@ -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.
|
||||
|
||||
+3
-2
@@ -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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user