summaryrefslogtreecommitdiff
path: root/src/radv.c
diff options
context:
space:
mode:
authorSimon Kelley <simon@thekelleys.org.uk>2015-03-11 21:36:30 +0000
committerSimon Kelley <simon@thekelleys.org.uk>2015-03-11 21:36:30 +0000
commitff841ebf5a5d6864ff48571f607c32ce80dbb75a (patch)
tree027985142b90373268a5aca31c0a74874a1c92cd /src/radv.c
parent360f2513ab12a9bf1e262d388dd2ea8a566590a3 (diff)
downloaddnsmasq-ff841ebf5a5d6864ff48571f607c32ce80dbb75a.tar.gz
Fix boilerplate code for re-running system calls on EINTR and EAGAIN etc.
The nasty code with static variable in retry_send() which avoids looping forever needs to be called on success of the syscall, to reset the static variable.
Diffstat (limited to 'src/radv.c')
-rw-r--r--src/radv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/radv.c b/src/radv.c
index 6da125b..d0faddf 100644
--- a/src/radv.c
+++ b/src/radv.c
@@ -479,8 +479,9 @@ static void send_ra(time_t now, int iface, char *iface_name, struct in6_addr *de
setsockopt(daemon->icmp6fd, IPPROTO_IPV6, IPV6_MULTICAST_IF, &iface, sizeof(iface));
}
- while (sendto(daemon->icmp6fd, daemon->outpacket.iov_base, save_counter(0), 0,
- (struct sockaddr *)&addr, sizeof(addr)) == -1 && retry_send());
+ while (retry_send(sendto(daemon->icmp6fd, daemon->outpacket.iov_base,
+ save_counter(0), 0, (struct sockaddr *)&addr,
+ sizeof(addr))));
}