]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/dnsmasq/011-Catch_errors_from_sendmsg_in_DHCP_code.patch
bird: New package
[ipfire-2.x.git] / src / patches / dnsmasq / 011-Catch_errors_from_sendmsg_in_DHCP_code.patch
1 From 98079ea89851da1df4966dfdfa1852a98da02912 Mon Sep 17 00:00:00 2001
2 From: Simon Kelley <simon@thekelleys.org.uk>
3 Date: Tue, 13 Oct 2015 20:30:32 +0100
4 Subject: [PATCH] Catch errors from sendmsg in DHCP code. Logs, eg, iptables
5 DROPS of dest 255.255.255.255
6
7 ---
8 src/dhcp.c | 7 ++++++-
9 1 file changed, 6 insertions(+), 1 deletion(-)
10
11 diff --git a/src/dhcp.c b/src/dhcp.c
12 index e6fceb1..1c85e42 100644
13 --- a/src/dhcp.c
14 +++ b/src/dhcp.c
15 @@ -452,8 +452,13 @@ void dhcp_packet(time_t now, int pxe_fd)
16 #endif
17
18 while(retry_send(sendmsg(fd, &msg, 0)));
19 +
20 + /* This can fail when, eg, iptables DROPS destination 255.255.255.255 */
21 + if (errno != 0)
22 + my_syslog(MS_DHCP | LOG_WARNING, _("Error sending DHCP packet to %s: %s"),
23 + inet_ntoa(dest.sin_addr), strerror(errno));
24 }
25 -
26 +
27 /* check against secondary interface addresses */
28 static int check_listen_addrs(struct in_addr local, int if_index, char *label,
29 struct in_addr netmask, struct in_addr broadcast, void *vparam)
30 --
31 1.7.10.4
32