Catch errors from sendmsg in DHCP code.

Logs, eg,  iptables DROPS of dest 255.255.255.255
This commit is contained in:
Simon Kelley
2015-10-13 20:30:32 +01:00
parent 4790115455
commit 98079ea898

View File

@@ -452,6 +452,11 @@ void dhcp_packet(time_t now, int pxe_fd)
#endif #endif
while(retry_send(sendmsg(fd, &msg, 0))); 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 */ /* check against secondary interface addresses */