Remove condition on uninitialized tv

Downstream patch originally included more. I failed to spot tv is not
initialized, when removed that not-functional part.
This commit is contained in:
Petr Menšík 2020-10-09 12:02:07 +02:00
parent 549005c787
commit 9d4a531b20
2 changed files with 10 additions and 8 deletions

View File

@ -1,4 +1,4 @@
From 31e14f6e52677c675ee4683f9daab5bf21c07dd6 Mon Sep 17 00:00:00 2001 From 02b6209f8085cbe3443f8623ccdc31f020825507 Mon Sep 17 00:00:00 2001
From: Petr Mensik <pemensik@redhat.com> From: Petr Mensik <pemensik@redhat.com>
Date: Wed, 31 Jul 2019 20:35:35 +0200 Date: Wed, 31 Jul 2019 20:35:35 +0200
Subject: [PATCH] Recent kernel no longer supports SIOCGSTAMP Subject: [PATCH] Recent kernel no longer supports SIOCGSTAMP
@ -6,11 +6,11 @@ Subject: [PATCH] Recent kernel no longer supports SIOCGSTAMP
Build without it defined by kernel headers. Do not try SO_TIMESTAMP Build without it defined by kernel headers. Do not try SO_TIMESTAMP
until fixed properly. until fixed properly.
--- ---
src/dhcp.c | 32 ++++++++++++++++++-------------- src/dhcp.c | 30 +++++++++++++++++-------------
1 file changed, 18 insertions(+), 14 deletions(-) 1 file changed, 17 insertions(+), 13 deletions(-)
diff --git a/src/dhcp.c b/src/dhcp.c diff --git a/src/dhcp.c b/src/dhcp.c
index f8d323b..9afdccf 100644 index bea4688..13373ae 100644
--- a/src/dhcp.c --- a/src/dhcp.c
+++ b/src/dhcp.c +++ b/src/dhcp.c
@@ -178,23 +178,27 @@ void dhcp_packet(time_t now, int pxe_fd) @@ -178,23 +178,27 @@ void dhcp_packet(time_t now, int pxe_fd)
@ -18,10 +18,9 @@ index f8d323b..9afdccf 100644
return; return;
- #if defined (HAVE_LINUX_NETWORK) - #if defined (HAVE_LINUX_NETWORK)
- if (ioctl(fd, SIOCGSTAMP, &tv) == 0)
+#if defined (HAVE_LINUX_NETWORK) +#if defined (HAVE_LINUX_NETWORK)
+#ifdef SIOCGSTAMP +#ifdef SIOCGSTAMP
+ if (tv.tv_sec == 0 && ioctl(fd, SIOCGSTAMP, &tv) == 0) if (ioctl(fd, SIOCGSTAMP, &tv) == 0)
recvtime = tv.tv_sec; recvtime = tv.tv_sec;
+#endif +#endif
@ -56,5 +55,5 @@ index f8d323b..9afdccf 100644
#elif defined(HAVE_BSD_NETWORK) #elif defined(HAVE_BSD_NETWORK)
if (msg.msg_controllen >= sizeof(struct cmsghdr)) if (msg.msg_controllen >= sizeof(struct cmsghdr))
-- --
2.20.1 2.26.2

View File

@ -20,7 +20,7 @@
Name: dnsmasq Name: dnsmasq
Version: 2.82 Version: 2.82
Release: 3%{?extraversion:.%{extraversion}}%{?dist} Release: 4%{?extraversion:.%{extraversion}}%{?dist}
Summary: A lightweight DHCP/caching DNS server Summary: A lightweight DHCP/caching DNS server
License: GPLv2 or GPLv3 License: GPLv2 or GPLv3
@ -184,6 +184,9 @@ install -Dpm 644 %{SOURCE2} %{buildroot}%{_sysusersdir}/%{name}.conf
%{_mandir}/man1/dhcp_* %{_mandir}/man1/dhcp_*
%changelog %changelog
* Fri Oct 09 2020 Petr Menšík <pemensik@redhat.com> - 2.82-4
- Remove uninitialized condition from downstream patch
* Wed Sep 30 2020 Petr Menšík <pemensik@redhat.com> - 2.82-3 * Wed Sep 30 2020 Petr Menšík <pemensik@redhat.com> - 2.82-3
- Listen only on localhost interface, return port unreachable on all others - Listen only on localhost interface, return port unreachable on all others
(#1852373) (#1852373)