mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 21:44:38 +08:00
send router solicitations every 4 seconds
See bug #53973 Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
parent
4fa33c17bc
commit
31e07f90bd
@ -90,6 +90,8 @@ static netif_addr_idx_t nd6_cached_destination_index;
|
|||||||
/* Multicast address holder. */
|
/* Multicast address holder. */
|
||||||
static ip6_addr_t multicast_address;
|
static ip6_addr_t multicast_address;
|
||||||
|
|
||||||
|
static u8_t nd6_tmr_rs_reduction;
|
||||||
|
|
||||||
/* Static buffer to parse RA packet options */
|
/* Static buffer to parse RA packet options */
|
||||||
union ra_options {
|
union ra_options {
|
||||||
struct lladdr_option lladdr;
|
struct lladdr_option lladdr;
|
||||||
@ -1131,15 +1133,20 @@ nd6_tmr(void)
|
|||||||
|
|
||||||
#if LWIP_IPV6_SEND_ROUTER_SOLICIT
|
#if LWIP_IPV6_SEND_ROUTER_SOLICIT
|
||||||
/* Send router solicitation messages, if necessary. */
|
/* Send router solicitation messages, if necessary. */
|
||||||
NETIF_FOREACH(netif) {
|
if (!nd6_tmr_rs_reduction) {
|
||||||
if ((netif->rs_count > 0) && netif_is_up(netif) &&
|
nd6_tmr_rs_reduction = (ND6_RTR_SOLICITATION_INTERVAL / ND6_TMR_INTERVAL) - 1;
|
||||||
netif_is_link_up(netif) &&
|
NETIF_FOREACH(netif) {
|
||||||
!ip6_addr_isinvalid(netif_ip6_addr_state(netif, 0)) &&
|
if ((netif->rs_count > 0) && netif_is_up(netif) &&
|
||||||
!ip6_addr_isduplicated(netif_ip6_addr_state(netif, 0))) {
|
netif_is_link_up(netif) &&
|
||||||
if (nd6_send_rs(netif) == ERR_OK) {
|
!ip6_addr_isinvalid(netif_ip6_addr_state(netif, 0)) &&
|
||||||
netif->rs_count--;
|
!ip6_addr_isduplicated(netif_ip6_addr_state(netif, 0))) {
|
||||||
|
if (nd6_send_rs(netif) == ERR_OK) {
|
||||||
|
netif->rs_count--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
nd6_tmr_rs_reduction--;
|
||||||
}
|
}
|
||||||
#endif /* LWIP_IPV6_SEND_ROUTER_SOLICIT */
|
#endif /* LWIP_IPV6_SEND_ROUTER_SOLICIT */
|
||||||
|
|
||||||
|
@ -58,6 +58,11 @@ extern "C" {
|
|||||||
/** 1 second period */
|
/** 1 second period */
|
||||||
#define ND6_TMR_INTERVAL 1000
|
#define ND6_TMR_INTERVAL 1000
|
||||||
|
|
||||||
|
/** Router solicitations are sent in 4 second intervals (see RFC 4861, ch. 6.3.7) */
|
||||||
|
#ifndef ND6_RTR_SOLICITATION_INTERVAL
|
||||||
|
#define ND6_RTR_SOLICITATION_INTERVAL 4000
|
||||||
|
#endif
|
||||||
|
|
||||||
struct pbuf;
|
struct pbuf;
|
||||||
struct netif;
|
struct netif;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user