diff options
Diffstat (limited to 'src/slaac.c')
-rw-r--r-- | src/slaac.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/slaac.c b/src/slaac.c index abaad53..13317d8 100644 --- a/src/slaac.c +++ b/src/slaac.c @@ -1,4 +1,4 @@ -/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley +/* dnsmasq is Copyright (c) 2000-2018 Simon Kelley This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -94,7 +94,7 @@ void slaac_add_addrs(struct dhcp_lease *lease, time_t now, int force) slaac->backoff = 1; slaac->addr = addr; /* Do RA's to prod it */ - ra_start_unsolicted(now, context); + ra_start_unsolicited(now, context); } if (slaac) @@ -146,8 +146,11 @@ time_t periodic_slaac(time_t now, struct dhcp_lease *leases) struct ping_packet *ping; struct sockaddr_in6 addr; - save_counter(0); - ping = expand(sizeof(struct ping_packet)); + reset_counter(); + + if (!(ping = expand(sizeof(struct ping_packet)))) + continue; + ping->type = ICMP6_ECHO_REQUEST; ping->code = 0; ping->identifier = ping_id; @@ -161,7 +164,7 @@ time_t periodic_slaac(time_t now, struct dhcp_lease *leases) addr.sin6_port = htons(IPPROTO_ICMPV6); addr.sin6_addr = slaac->addr; - if (sendto(daemon->icmp6fd, daemon->outpacket.iov_base, save_counter(0), 0, + if (sendto(daemon->icmp6fd, daemon->outpacket.iov_base, save_counter(-1), 0, (struct sockaddr *)&addr, sizeof(addr)) == -1 && errno == EHOSTUNREACH) slaac->ping_time = 0; /* Give up */ |