]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/dnsmasq/011-Catch_errors_from_sendmsg_in_DHCP_code.patch
kernel: update to 3.14.62
[ipfire-2.x.git] / src / patches / dnsmasq / 011-Catch_errors_from_sendmsg_in_DHCP_code.patch
CommitLineData
40e1bbda
MF
1From 98079ea89851da1df4966dfdfa1852a98da02912 Mon Sep 17 00:00:00 2001
2From: Simon Kelley <simon@thekelleys.org.uk>
3Date: Tue, 13 Oct 2015 20:30:32 +0100
4Subject: [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
11diff --git a/src/dhcp.c b/src/dhcp.c
12index 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--
311.7.10.4
32