2020-10-09 10:02:07 +00:00
|
|
|
From 02b6209f8085cbe3443f8623ccdc31f020825507 Mon Sep 17 00:00:00 2001
|
2019-08-09 13:19:39 +00:00
|
|
|
From: Petr Mensik <pemensik@redhat.com>
|
|
|
|
Date: Wed, 31 Jul 2019 20:35:35 +0200
|
|
|
|
Subject: [PATCH] Recent kernel no longer supports SIOCGSTAMP
|
|
|
|
|
|
|
|
Build without it defined by kernel headers. Do not try SO_TIMESTAMP
|
|
|
|
until fixed properly.
|
|
|
|
---
|
2020-10-09 10:02:07 +00:00
|
|
|
src/dhcp.c | 30 +++++++++++++++++-------------
|
|
|
|
1 file changed, 17 insertions(+), 13 deletions(-)
|
2019-08-09 13:19:39 +00:00
|
|
|
|
|
|
|
diff --git a/src/dhcp.c b/src/dhcp.c
|
2020-10-09 10:02:07 +00:00
|
|
|
index bea4688..13373ae 100644
|
2019-08-09 13:19:39 +00:00
|
|
|
--- a/src/dhcp.c
|
|
|
|
+++ b/src/dhcp.c
|
|
|
|
@@ -178,23 +178,27 @@ void dhcp_packet(time_t now, int pxe_fd)
|
|
|
|
(sz < (ssize_t)(sizeof(*mess) - sizeof(mess->options))))
|
|
|
|
return;
|
|
|
|
|
|
|
|
- #if defined (HAVE_LINUX_NETWORK)
|
|
|
|
+#if defined (HAVE_LINUX_NETWORK)
|
|
|
|
+#ifdef SIOCGSTAMP
|
2020-10-09 10:02:07 +00:00
|
|
|
if (ioctl(fd, SIOCGSTAMP, &tv) == 0)
|
2019-08-09 13:19:39 +00:00
|
|
|
recvtime = tv.tv_sec;
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
if (msg.msg_controllen >= sizeof(struct cmsghdr))
|
|
|
|
- for (cmptr = CMSG_FIRSTHDR(&msg); cmptr; cmptr = CMSG_NXTHDR(&msg, cmptr))
|
|
|
|
- if (cmptr->cmsg_level == IPPROTO_IP && cmptr->cmsg_type == IP_PKTINFO)
|
|
|
|
- {
|
|
|
|
- union {
|
|
|
|
- unsigned char *c;
|
|
|
|
- struct in_pktinfo *p;
|
|
|
|
- } p;
|
|
|
|
- p.c = CMSG_DATA(cmptr);
|
|
|
|
- iface_index = p.p->ipi_ifindex;
|
|
|
|
- if (p.p->ipi_addr.s_addr != INADDR_BROADCAST)
|
|
|
|
- unicast_dest = 1;
|
|
|
|
- }
|
|
|
|
+ {
|
|
|
|
+ for (cmptr = CMSG_FIRSTHDR(&msg); cmptr; cmptr = CMSG_NXTHDR(&msg, cmptr))
|
|
|
|
+ if (cmptr->cmsg_level == IPPROTO_IP && cmptr->cmsg_type == IP_PKTINFO)
|
|
|
|
+ {
|
|
|
|
+ union {
|
|
|
|
+ unsigned char *c;
|
|
|
|
+ struct in_pktinfo *p;
|
|
|
|
+ } p;
|
|
|
|
+ p.c = CMSG_DATA(cmptr);
|
|
|
|
+ iface_index = p.p->ipi_ifindex;
|
|
|
|
+ if (p.p->ipi_addr.s_addr != INADDR_BROADCAST)
|
|
|
|
+ unicast_dest = 1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
#elif defined(HAVE_BSD_NETWORK)
|
|
|
|
if (msg.msg_controllen >= sizeof(struct cmsghdr))
|
|
|
|
--
|
2020-10-09 10:02:07 +00:00
|
|
|
2.26.2
|
2019-08-09 13:19:39 +00:00
|
|
|
|