]> git.ipfire.org Git - people/ms/dnsmasq.git/commitdiff
Catch errors from sendmsg in DHCP code.
authorSimon Kelley <simon@thekelleys.org.uk>
Tue, 13 Oct 2015 19:30:32 +0000 (20:30 +0100)
committerSimon Kelley <simon@thekelleys.org.uk>
Tue, 13 Oct 2015 19:32:21 +0000 (20:32 +0100)
 Logs, eg,  iptables DROPS of dest 255.255.255.255

src/dhcp.c

index e6fceb13a3e1da9f1d104506f0279b0bfc3e3b27..1c85e42691e29e1f72043efb32044001353dcfb8 100644 (file)
@@ -452,8 +452,13 @@ void dhcp_packet(time_t now, int pxe_fd)
 #endif
   
   while(retry_send(sendmsg(fd, &msg, 0)));
+
+  /* This can fail when, eg, iptables DROPS destination 255.255.255.255 */
+  if (errno != 0)
+    my_syslog(MS_DHCP | LOG_WARNING, _("Error sending DHCP packet to %s: %s"),
+             inet_ntoa(dest.sin_addr), strerror(errno));
 }
+
 /* check against secondary interface addresses */
 static int check_listen_addrs(struct in_addr local, int if_index, char *label,
                              struct in_addr netmask, struct in_addr broadcast, void *vparam)