--- embedaddon/dnsmasq/src/slaac.c 2016/11/02 09:57:01 1.1.1.3 +++ embedaddon/dnsmasq/src/slaac.c 2021/03/17 00:56:46 1.1.1.4 @@ -1,4 +1,4 @@ -/* dnsmasq is Copyright (c) 2000-2016 Simon Kelley +/* dnsmasq is Copyright (c) 2000-2021 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 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 *l 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,9 +164,10 @@ time_t periodic_slaac(time_t now, struct dhcp_lease *l 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) + errno == EHOSTUNREACH && + slaac->backoff == 12) slaac->ping_time = 0; /* Give up */ else {