diff --git a/arch/arm/src/stm32/stm32_eth.c b/arch/arm/src/stm32/stm32_eth.c index d41e25ee698..ddb268c6662 100644 --- a/arch/arm/src/stm32/stm32_eth.c +++ b/arch/arm/src/stm32/stm32_eth.c @@ -3537,6 +3537,15 @@ static void stm32_ipv6multicast(FAR struct stm32_ethmac_s *priv) (void)stm32_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_AUTOCONF */ +#ifdef CONFIG_NET_ICMPv6_ROUTER + /* Add the IPv6 all link-local routers Ethernet address. This is the + * address that we expect to receive ICMPv6 Router Solicitation + * packets. + */ + + (void)stm32_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); + +#endif /* CONFIG_NET_ICMPv6_ROUTER */ } #endif /* CONFIG_NET_ICMPv6 */ diff --git a/arch/arm/src/tiva/tm4c_ethernet.c b/arch/arm/src/tiva/tm4c_ethernet.c index 71bad040818..a30377cb1af 100644 --- a/arch/arm/src/tiva/tm4c_ethernet.c +++ b/arch/arm/src/tiva/tm4c_ethernet.c @@ -3995,6 +3995,15 @@ static void tiva_ipv6multicast(FAR struct tiva_ethmac_s *priv) (void)tiva_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); #endif /* CONFIG_NET_ICMPv6_AUTOCONF */ +#ifdef CONFIG_NET_ICMPv6_ROUTER + /* Add the IPv6 all link-local routers Ethernet address. This is the + * address that we expect to receive ICMPv6 Router Solicitation + * packets. + */ + + (void)tiva_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); + +#endif /* CONFIG_NET_ICMPv6_ROUTER */ } #endif /* CONFIG_NET_ICMPv6 */ diff --git a/net/icmpv6/icmpv6.h b/net/icmpv6/icmpv6.h index 53d345fe9cb..1a6c7d7b569 100644 --- a/net/icmpv6/icmpv6.h +++ b/net/icmpv6/icmpv6.h @@ -273,6 +273,28 @@ void icmpv6_rsolicit(FAR struct net_driver_s *dev); void icmpv6_advertise(FAR struct net_driver_s *dev, const net_ipv6addr_t destipaddr); +/**************************************************************************** + * Name: icmpv6_radvertise + * + * Description: + * Send an ICMPv6 Router Advertisement + * + * Parameters: + * dev - The device driver structure containing the outgoing ICMPv6 packet + * buffer + * + * Return: + * None + * + * Assumptions: + * The network is locked + * + ****************************************************************************/ + +#ifdef CONFIG_NET_ICMPv6_ROUTER +void icmpv6_radvertise(FAR struct net_driver_s *dev); +#endif + /**************************************************************************** * Function: icmpv6_wait_setup * diff --git a/net/icmpv6/icmpv6_input.c b/net/icmpv6/icmpv6_input.c index 3ed539ce78a..f6e30008bde 100644 --- a/net/icmpv6/icmpv6_input.c +++ b/net/icmpv6/icmpv6_input.c @@ -194,6 +194,23 @@ void icmpv6_input(FAR struct net_driver_s *dev) } break; +#ifdef CONFIG_NET_ICMPv6_ROUTER + /* Check if we received a Router Solicitation */ + + case ICMPV6_ROUTER_SOLICIT: + { + /* Just give a knee-jerk Router Advertisement in respond with no + * further examination of the Router Solicitation. + */ + + icmpv6_radvertise(dev); + + /* All statistics have been updated. Nothing to do but exit. */ + + return; + } +#endif + #ifdef CONFIG_NET_ICMPv6_AUTOCONF /* Check if we received a Router Advertisement */