From f73f7397d7e99f8412b7dc465061d20f642cdc85 Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Tue, 3 Dec 2019 18:18:46 +0000 Subject: [PATCH] Fix bug which gave zero-length DHCPv6 packets if sendto() is interrupted. --- CHANGELOG | 3 +++ src/dhcp6.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 2590e8b..7d0f5ce 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -57,6 +57,9 @@ version 2.81 Fix a bug which stopped --dhcp-name-match from working when a hostname is supplied in --dhcp-host. Thanks to James Feeney for spotting this. + Fix bug which caused very rarely caused zero-length DHCPv6 packets. + Thanks to Dereck Higgins for spotting this. + version 2.80 Add support for RFC 4039 DHCP rapid commit. Thanks to Ashram Method diff --git a/src/dhcp6.c b/src/dhcp6.c index ce682db..5f4b839 100644 --- a/src/dhcp6.c +++ b/src/dhcp6.c @@ -245,7 +245,7 @@ void dhcp6_packet(time_t now) { from.sin6_port = htons(port); while (retry_send(sendto(daemon->dhcp6fd, daemon->outpacket.iov_base, - save_counter(0), 0, (struct sockaddr *)&from, + save_counter(-1), 0, (struct sockaddr *)&from, sizeof(from)))); } }