Skip to content

Commit

Permalink
network: Wait 4 seconds for RA before re-sending RS messages
Browse files Browse the repository at this point in the history
As per RFC 4861, a host should transmit up to 3 Router Solicitation
messages, each separated by at least RTR_SOLICITATION_INTERVAL(4)
seconds to obtain RA for IPv6 auto-configuration.
  • Loading branch information
niraj-g authored and LaakkonenJussi committed Mar 12, 2021
1 parent a4aedf9 commit a3a4a14
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions connman/src/network.c
Expand Up @@ -45,6 +45,13 @@
#define WIFI_BSSID_LEN 6
#define WIFI_BSSID_STR_LEN 18

/*
* As per RFC 4861, a host should transmit up to MAX_RTR_SOLICITATIONS(3)
* Router Solicitation messages, each separated by at least
* RTR_SOLICITATION_INTERVAL(4) seconds to obtain RA for IPv6 auto-configuration.
*/
#define RTR_SOLICITATION_INTERVAL 4

static GSList *network_list = NULL;
static GSList *driver_list = NULL;

Expand Down Expand Up @@ -438,7 +445,7 @@ static void check_dhcpv6(struct nd_router_advert *reply,
DBG("re-send router solicitation %d",
network->router_solicit_count);
network->router_solicit_count--;
__connman_inet_ipv6_send_rs(network->index, 1,
__connman_inet_ipv6_send_rs(network->index, RTR_SOLICITATION_INTERVAL,
check_dhcpv6, network);
return;
}
Expand Down Expand Up @@ -591,7 +598,8 @@ static void autoconf_ipv6_set(struct connman_network *network)

/* Try to get stateless DHCPv6 information, RFC 3736 */
network->router_solicit_count = 3;
__connman_inet_ipv6_send_rs(index, 1, check_dhcpv6, network);
__connman_inet_ipv6_send_rs(index, RTR_SOLICITATION_INTERVAL,
check_dhcpv6, network);
}

static void set_connected(struct connman_network *network)
Expand Down

0 comments on commit a3a4a14

Please sign in to comment.