From 823348da5567018fef4dfd9b1aee517f1bba06d0 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Wed, 22 Jun 2016 13:38:28 +0200 Subject: [PATCH] Fix: Failed to bind to device (#1348934) Resolves: #1348934 --- iputils-reorder-I-parsing.patch | 37 +++++++++++++++++++++++++++++++++ iputils.spec | 7 ++++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 iputils-reorder-I-parsing.patch diff --git a/iputils-reorder-I-parsing.patch b/iputils-reorder-I-parsing.patch new file mode 100644 index 0000000..e646955 --- /dev/null +++ b/iputils-reorder-I-parsing.patch @@ -0,0 +1,37 @@ +commit 1f6f39b84f81cfa6bc243557a68eebeeac7e8ea3 +Author: Robert Schiele +Date: Mon Mar 14 09:18:08 2016 +0100 + + reorder -I option parsing + + This changes -I option parsing in a way that device is only assigned + if neither an IPv4 nor an IPv6 address is detected. Otherwise those + addresses are misinterpreted as device names and as such will cause + error messages later in the code. + + Signed-off-by: Robert Schiele + +diff --git a/ping.c b/ping.c +index c42d6eb..498c0e8 100644 +--- a/ping.c ++++ b/ping.c +@@ -279,10 +279,6 @@ main(int argc, char **argv) + break; + } + case 'I': +- if (inet_pton(AF_INET, optarg, &source.sin_addr) > 0) +- options |= F_STRICTSOURCE; +- else +- device = optarg; + /* IPv6 */ + if (strchr(optarg, ':')) { + char *p, *addr = strdup(optarg); +@@ -306,6 +302,8 @@ main(int argc, char **argv) + options |= F_STRICTSOURCE; + + free(addr); ++ } else if (inet_pton(AF_INET, optarg, &source.sin_addr) > 0) { ++ options |= F_STRICTSOURCE; + } else { + device = optarg; + } diff --git a/iputils.spec b/iputils.spec index c8068ab..0ae9e0f 100644 --- a/iputils.spec +++ b/iputils.spec @@ -3,7 +3,7 @@ Summary: Network monitoring tools including ping Name: iputils Version: 20160308 -Release: 2%{?dist} +Release: 3%{?dist} # some parts are under the original BSD (ping.c) # some are under GPLv2+ (tracepath.c) License: BSD and GPLv2+ @@ -20,6 +20,7 @@ Source5: https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt Patch0: iputils-rh.patch Patch1: iputils-ifenslave.patch +Patch2: iputils-reorder-I-parsing.patch BuildRequires: docbook-utils perl-SGMLSpm BuildRequires: glibc-kernheaders >= 2.4-8.19 @@ -57,6 +58,7 @@ cp %{SOURCE4} %{SOURCE5} . %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build %ifarch s390 s390x @@ -158,6 +160,9 @@ mv -f RELNOTES.tmp RELNOTES %attr(644,root,root) %{_mandir}/man8/ninfod.8.gz %changelog +* Wed Jun 22 2016 Jan Synáček - 20160308-3 +- Fix: Failed to bind to device (#1348934) + * Wed Mar 9 2016 Jan Synáček - 20160308-2 - Don't build against libnettle