diff options
author | Petr Menšík <pemensik@redhat.com> | 2021-09-03 16:48:50 +0200 |
---|---|---|
committer | Simon Kelley <simon@thekelleys.org.uk> | 2021-09-11 21:36:30 +0100 |
commit | 1e6565c1a570cc142e52a69128a8db69d4d777f0 (patch) | |
tree | 1932220ad88007d04e0ca4c5e79183d7c2926b47 | |
parent | fc522515b9a45fb710364a24acadbc7e7591ad00 (diff) | |
download | dnsmasq-1e6565c1a570cc142e52a69128a8db69d4d777f0.tar.gz |
Retry dhcp6 ping on interrupts
Error: CHECKED_RETURN (CWE-252): [#def35]
dnsmasq-2.86test7/src/dhcp6.c:295: check_return: Calling "sendto(dnsmasq_daemon->icmp6fd, &neigh, 24UL, 0, __CONST_SOCKADDR_ARG({.__sockaddr__ = &addr.sa}), 28U)" without checking return value. This library function may fail and return an error code.
# 293| break;
# 294|
# 295|-> sendto(daemon->icmp6fd, &neigh, sizeof(neigh), 0, &addr.sa, sizeof(addr));
# 296|
# 297| ts.tv_sec = 0;
-rw-r--r-- | src/dhcp6.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dhcp6.c b/src/dhcp6.c index 2be877f..ae1f5c1 100644 --- a/src/dhcp6.c +++ b/src/dhcp6.c @@ -292,7 +292,7 @@ void get_client_mac(struct in6_addr *client, int iface, unsigned char *mac, unsi if ((maclen = find_mac(&addr, mac, 0, now)) != 0) break; - sendto(daemon->icmp6fd, &neigh, sizeof(neigh), 0, &addr.sa, sizeof(addr)); + while(retry_send(sendto(daemon->icmp6fd, &neigh, sizeof(neigh), 0, &addr.sa, sizeof(addr)))); ts.tv_sec = 0; ts.tv_nsec = 100000000; /* 100ms */ |