diff options
| author | aozima <[email protected]> | 2017-12-19 20:01:28 +0800 |
|---|---|---|
| committer | aozima <[email protected]> | 2017-12-19 20:08:07 +0800 |
| commit | d483f25f43105fcdafc5929abf6cf6d3866b32a7 (patch) | |
| tree | c7acdb0d69bcf0e7b534036f5885189b4c4f7a83 /components | |
| parent | 95b0da14cbfec30b99a4cbaf782b88f90e1d555e (diff) | |
[LWIP] add IPV6 mld_mac_filter() for multicast filter.
Diffstat (limited to 'components')
| -rw-r--r-- | components/net/lwip-2.0.2/src/netif/ethernetif.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/components/net/lwip-2.0.2/src/netif/ethernetif.c b/components/net/lwip-2.0.2/src/netif/ethernetif.c index bd28815c4b..ba23528c58 100644 --- a/components/net/lwip-2.0.2/src/netif/ethernetif.c +++ b/components/net/lwip-2.0.2/src/netif/ethernetif.c @@ -173,10 +173,26 @@ static err_t eth_netif_device_init(struct netif *netif) netif->flags = (ethif->flags & 0xff); #if LWIP_IPV6 - netif->output_ip6 = ethip6_output; - netif->ip6_autoconfig_enabled = 1; - netif_create_ip6_linklocal_address(netif, 1); - netif->flags |= NETIF_FLAG_MLD6; + netif->output_ip6 = ethip6_output; + netif->ip6_autoconfig_enabled = 1; + netif_create_ip6_linklocal_address(netif, 1); + +#if LWIP_IPV6_MLD + netif->flags |= NETIF_FLAG_MLD6; + + /* + * For hardware/netifs that implement MAC filtering. + * All-nodes link-local is handled by default, so we must let the hardware know + * to allow multicast packets in. + * Should set mld_mac_filter previously. */ + if (netif->mld_mac_filter != NULL) + { + ip6_addr_t ip6_allnodes_ll; + ip6_addr_set_allnodes_linklocal(&ip6_allnodes_ll); + netif->mld_mac_filter(netif, &ip6_allnodes_ll, NETIF_ADD_MAC_FILTER); + } +#endif /* LWIP_IPV6_MLD */ + #endif /* LWIP_IPV6 */ /* set default netif */ |
