From 2a9bd4b102cf6b1edafacfd4a81c9b8dc39d8584 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Tue, 27 Nov 2012 13:24:34 +0100 Subject: [PATCH] Update ifaddrs patch --- iputils-20121121-ifaddrs.patch | 74 ++++++++++++++++++++++++++++++++-- iputils.spec | 1 + 2 files changed, 72 insertions(+), 3 deletions(-) diff --git a/iputils-20121121-ifaddrs.patch b/iputils-20121121-ifaddrs.patch index 7eca900..8c42496 100644 --- a/iputils-20121121-ifaddrs.patch +++ b/iputils-20121121-ifaddrs.patch @@ -1,6 +1,62 @@ ---- iputils-s20121121/arping.c.orig 2012-11-21 11:32:18.000000000 +0100 -+++ iputils-s20121121/arping.c 2012-11-26 10:33:36.457178827 +0100 -@@ -66,7 +66,7 @@ static void usage(void) __attribute__((n +From da9c6e97214f88739212a23bb3bbe4f9d2ff6258 Mon Sep 17 00:00:00 2001 +From: Jan Synacek +Date: Tue, 27 Nov 2012 09:38:13 +0100 +Subject: [PATCH 1/2] arping: Fix finding of a default interface when no -I is + specified. + +By default, no interface string should be supplied. This ensures that we can +recognize if an interface was specified or omitted. Previously, when -I was not +used, default interface string was compiled-in and the automatic selection +didn't work correctly. + +RH-Bugzilla: #879807 +Signed-off-by: Jan Synacek +--- + Makefile | 4 +--- + arping.c | 11 ++--------- + 2 files changed, 3 insertions(+), 12 deletions(-) + +diff --git a/Makefile b/Makefile +index ae92f34..b5bf84f 100644 +--- a/Makefile ++++ b/Makefile +@@ -24,8 +24,6 @@ USE_SYSFS=no + USE_IDN=no + # Do not use getifaddrs + WITHOUT_IFADDRS=no +-# arping default device +-ARPING_DEFAULT_DEVICE=eth0 + # rdisc server (-r option) support + ENABLE_RDISC_SERVER=no + # ping6 source routing (deprecated by RFC5095) +@@ -99,7 +97,7 @@ $(TARGETS): %: %.o + + # ------------------------------------- + # arping +-DEF_arping = $(DEF_SYSFS) $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS) -DDEFAULT_DEVICE=\"$(ARPING_DEFAULT_DEVICE)\" ++DEF_arping = $(DEF_SYSFS) $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS) + LIB_arping = $(LIB_SYSFS) $(LIB_CAP) $(LIB_IDN) + + # clockdiff +diff --git a/arping.c b/arping.c +index f6433c2..ccb68a0 100644 +--- a/arping.c ++++ b/arping.c +@@ -55,13 +55,6 @@ struct sysf_devattr_values; + + static void usage(void) __attribute__((noreturn)); + +-#ifdef DEFAULT_DEVICE +-# define DEFAULT_DEVICE_STR DEFAULT_DEVICE +-#else +-# define DEFAULT_DEVICE_STR "no default" +-# define DEFAULT_DEVICE NULL +-#endif +- + struct device { + char *name; + int ifindex; +@@ -75,7 +68,7 @@ struct device { int quit_on_reply=0; struct device device = { @@ -9,3 +65,15 @@ }; char *source; struct in_addr src, dst; +@@ -128,7 +121,7 @@ void usage(void) + " -V : print version and exit\n" + " -c count : how many packets to send\n" + " -w timeout : how long to wait for a reply\n" +- " -I device : which ethernet device to use (" DEFAULT_DEVICE_STR ")\n" ++ " -I device : which ethernet device to use\n" + " -s source : source ip address\n" + " destination : ask for what ip address\n" + ); +-- +1.7.11.7 + diff --git a/iputils.spec b/iputils.spec index 98a3964..07f328a 100644 --- a/iputils.spec +++ b/iputils.spec @@ -147,6 +147,7 @@ mv -f RELNOTES.tmp RELNOTES %changelog * Mon Nov 26 2012 Jan Synáček - 20121125-2 - Comment patches and cleanup +- Update ifaddrs patch * Mon Nov 26 2012 Jan Synáček - 20121125-1 - Update to iputils-s20121125 (#879952)