From: Steven Barth Date: Thu, 31 Jan 2013 15:38:48 +0000 (+0100) Subject: Fix RS attempts X-Git-Tag: debian/1.1+git20160131-1~189 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=odhcp6c.git;a=commitdiff_plain;h=251a83ec4663ba5e5466df6330c741c2739b00dc Fix RS attempts --- diff --git a/src/ra.c b/src/ra.c index 602191a..597de58 100644 --- a/src/ra.c +++ b/src/ra.c @@ -21,7 +21,7 @@ static int sock = -1, rtnl_sock = -1; static unsigned if_index = 0; static char if_name[IF_NAMESIZE] = {0}; -static volatile int rs_attempt = 1; +static volatile int rs_attempt = 0; static struct in6_addr lladdr = IN6ADDR_ANY_INIT; static void ra_send_rs(int signal __attribute__((unused))); @@ -97,7 +97,7 @@ static void ra_send_rs(int signal __attribute__((unused))) const struct sockaddr_in6 dest = {AF_INET6, 0, 0, ALL_IPV6_ROUTERS, if_index}; sendto(sock, &rs, sizeof(rs), MSG_DONTWAIT, (struct sockaddr*)&dest, sizeof(dest)); - if (++rs_attempt < 3) + if (++rs_attempt <= 3) alarm(4); }