mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
Merge branch 'fix/eth-allnodes-multicast-filter' into 'master'
fix(esp_netif): add all-nodes multicast filter See merge request espressif/esp-idf!52447
This commit is contained in:
@@ -682,6 +682,13 @@ static err_t netif_mld_mac_filter_cb(struct netif *netif, const ip6_addr_t *grou
|
||||
}
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
static void netif_mld_mac_filter_all_nodes(struct netif *netif, enum netif_mac_filter_action action)
|
||||
{
|
||||
ip6_addr_t all_nodes;
|
||||
ip6_addr_set_allnodes_linklocal(&all_nodes);
|
||||
netif_mld_mac_filter_cb(netif, &all_nodes, action);
|
||||
}
|
||||
#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */
|
||||
|
||||
static esp_err_t esp_netif_init_configuration(esp_netif_t *esp_netif, const esp_netif_config_t *cfg)
|
||||
@@ -953,7 +960,15 @@ static void esp_netif_lwip_remove(esp_netif_t *esp_netif)
|
||||
if (netif_is_up(esp_netif->lwip_netif)) {
|
||||
netif_set_down(esp_netif->lwip_netif);
|
||||
}
|
||||
#if LWIP_IPV6 && LWIP_IPV6_MLD
|
||||
if (esp_netif->driver_set_mac_filter && esp_netif->lwip_netif->mld_mac_filter) {
|
||||
netif_mld_mac_filter_all_nodes(esp_netif->lwip_netif, NETIF_DEL_MAC_FILTER);
|
||||
}
|
||||
#endif
|
||||
netif_remove(esp_netif->lwip_netif);
|
||||
#if LWIP_IPV6 && LWIP_IPV6_MLD
|
||||
netif_set_mld_mac_filter(esp_netif->lwip_netif, NULL);
|
||||
#endif
|
||||
#if ESP_GRATUITOUS_ARP
|
||||
if (esp_netif->flags & ESP_NETIF_FLAG_GARP) {
|
||||
netif_unset_garp_flag(esp_netif->lwip_netif);
|
||||
@@ -1044,6 +1059,8 @@ static esp_err_t esp_netif_lwip_add(esp_netif_t *esp_netif)
|
||||
#endif
|
||||
#if LWIP_IPV6 && LWIP_IPV6_MLD
|
||||
netif_set_mld_mac_filter(esp_netif->lwip_netif, netif_mld_mac_filter_cb);
|
||||
/* ff02::1 is implicitly joined and therefore absent from the MLD group list. */
|
||||
netif_mld_mac_filter_all_nodes(esp_netif->lwip_netif, NETIF_ADD_MAC_FILTER);
|
||||
/* Align L2 multicast filters with current MLD groups, since mld6 processing
|
||||
* may have started before the callback was registered. */
|
||||
if (esp_netif->lwip_netif && (esp_netif->lwip_netif->flags & NETIF_FLAG_MLD6)) {
|
||||
|
||||
@@ -269,13 +269,13 @@ static void ethernet_deinit(test_vfs_eth_network_t *network_hndls)
|
||||
TEST_ESP_OK(esp_eth_del_netif_glue(network_hndls->netif_io_driver));
|
||||
}
|
||||
#endif // CONFIG_L2TAP_TEST_USE_ETH_SUBLAYER
|
||||
esp_eth_driver_uninstall(network_hndls->eth_handle);
|
||||
TEST_ESP_OK(network_hndls->phy->del(network_hndls->phy));
|
||||
TEST_ESP_OK(network_hndls->mac->del(network_hndls->mac));
|
||||
if (network_hndls->eth_netif) {
|
||||
TEST_ESP_OK(esp_event_handler_unregister(IP_EVENT, IP_EVENT_ETH_GOT_IP, got_ip_event_handler));
|
||||
esp_netif_destroy(network_hndls->eth_netif);
|
||||
}
|
||||
esp_eth_driver_uninstall(network_hndls->eth_handle);
|
||||
TEST_ESP_OK(network_hndls->phy->del(network_hndls->phy));
|
||||
TEST_ESP_OK(network_hndls->mac->del(network_hndls->mac));
|
||||
TEST_ESP_OK(esp_event_handler_unregister(ETH_EVENT, ESP_EVENT_ANY_ID, eth_event_handler));
|
||||
vEventGroupDelete(network_hndls->eth_event_group);
|
||||
network_hndls->eth_event_group = NULL;
|
||||
|
||||
Reference in New Issue
Block a user