Update to iputils-s20121121, drop unnecessary patches

This commit is contained in:
Jan Synacek 2012-11-22 08:01:47 +01:00
parent 994285713d
commit a3b0ea0704
10 changed files with 26 additions and 233 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ ifenslave.tar.gz
/iputils-s20121011.tar.bz2
/iputils-s20121106.tar.bz2
/iputils-s20121112.tar.bz2
/iputils-s20121121.tar.bz2

View File

@ -1,21 +1,20 @@
--- iputils-s20121106/Makefile.orig 2012-11-05 19:13:50.000000000 +0100
+++ iputils-s20121106/Makefile 2012-11-06 14:03:03.214464415 +0100
@@ -21,8 +21,7 @@
--- iputils-s20121121/Makefile.orig 2012-11-21 11:32:18.000000000 +0100
+++ iputils-s20121121/Makefile 2012-11-22 07:29:27.947670530 +0100
@@ -29,7 +29,7 @@
# -------------------------------------
# What a pity, all new gccs are buggy and -Werror does not work. Sigh.
#CCOPT=-Wstrict-prototypes -Wall -g -Werror
-CCOPT=-Wstrict-prototypes -Wall -g
-CCOPTOPT=-O2
+CCOPT=-Wstrict-prototypes -fno-strict-aliasing -Werror
# CCOPT=-fno-strict-aliasing -Wstrict-prototypes -Wall -Werror -g
-CCOPT=-fno-strict-aliasing -Wstrict-prototypes -Wall -g
+CCOPT=-fno-strict-aliasing -Wstrict-prototypes -Wall -g -Werror
CCOPTOPT=-O3
GLIBCFIX=-D_GNU_SOURCE
DEFINES=
LDLIB=
@@ -42,7 +41,7 @@
@@ -63,7 +63,7 @@
IPV6_TARGETS=tracepath6 traceroute6 ping6
TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS)
-CFLAGS=$(CCOPTOPT) $(CCOPT) $(GLIBCFIX) $(DEFINES)
+CFLAGS+=$(RPM_OPT_FLAGS) $(CCOPT) $(GLIBCFIX) $(DEFINES)
+CFLAGS+=$(RPM_OPT_FLAGS) $(CCOPTOPT) $(CCOPT) $(GLIBCFIX) $(DEFINES)
LDLIBS=$(LDLIB) $(ADDLIB)
LASTTAG:=`git describe HEAD | sed -e 's/-.*//'`

View File

@ -1,43 +0,0 @@
diff -up iputils-s20071127/ping.c.ia64_align iputils-s20071127/ping.c
--- iputils-s20071127/ping.c.ia64_align 2008-06-02 08:56:32.000000000 +0200
+++ iputils-s20071127/ping.c 2008-06-02 08:56:32.000000000 +0200
@@ -200,13 +200,13 @@ main(int argc, char **argv)
ptr[3] = i4;
options |= F_STRICTSOURCE;
} else {
- device = optarg;
+ device = strdup(optarg);
}
#else
if (inet_pton(AF_INET, optarg, &source.sin_addr) > 0)
options |= F_STRICTSOURCE;
else
- device = optarg;
+ device = strdup(optarg);
#endif
break;
}
diff -up iputils-s20071127/arping.c.ia64_align iputils-s20071127/arping.c
--- iputils-s20071127/arping.c.ia64_align 2008-06-02 08:56:32.000000000 +0200
+++ iputils-s20071127/arping.c 2008-06-02 08:56:32.000000000 +0200
@@ -351,7 +351,7 @@ main(int argc, char **argv)
timeout = atoi(optarg);
break;
case 'I':
- device = optarg;
+ device = strdup(optarg);
break;
case 'f':
quit_on_reply=1;
diff -up iputils-s20071127/ping6.c.ia64_align iputils-s20071127/ping6.c
--- iputils-s20071127/ping6.c.ia64_align 2008-06-02 08:56:32.000000000 +0200
+++ iputils-s20071127/ping6.c 2008-06-02 08:56:32.000000000 +0200
@@ -581,7 +581,7 @@ int main(int argc, char *argv[])
free(addr);
} else {
- device = optarg;
+ device = strdup(optarg);
}
break;
case 'M':

View File

@ -1,89 +0,0 @@
--- iputils-s20121112/arping.c.orig 2012-11-13 12:12:51.000000000 +0100
+++ iputils-s20121112/arping.c 2012-11-13 12:15:11.514261164 +0100
@@ -50,7 +50,7 @@
static void usage(void) __attribute__((noreturn));
int quit_on_reply=0;
-char *device="eth0";
+char *device=NULL;
int ifindex;
char *source;
struct in_addr src, dst;
@@ -71,6 +71,10 @@ struct timeval start, last;
int sent, brd_sent;
int received, brd_recv, req_recv;
+#define PREF_ETH "eth"
+#define PREF_EM "em"
+static char *dev_file = "/proc/self/net/dev";
+
#ifndef CAPABILITIES
static uid_t euid;
#endif
@@ -524,6 +528,46 @@ static void set_device_broadcast(char *d
return;
}
+/*
+ * get_first_ethernet - return the name of the first ethernet-style
+ * interface on this system.
+ */
+char * get_first_ethernet(void)
+{
+ FILE *f;
+ char buf[255], *dv, *smc;
+ char pci[16];
+
+ memset(pci, 0, sizeof(pci));
+ if ((f = fopen(dev_file, "r")) != NULL)
+ {
+ // go through network dev file
+ while (fgets (buf, sizeof(buf), f) != NULL)
+ {
+ // the line describes interface
+ if ((smc = strchr(buf, ':')) != NULL)
+ {
+ // trim white characters
+ for (dv=buf, *smc=0; *dv <= ' '; dv++) ;
+ // is "eth" (originial ethernet name) or "em" (ethernet on board)
+ if (!strncmp(dv, PREF_ETH, strlen(PREF_ETH)) ||
+ !strncmp(dv, PREF_EM, strlen(PREF_EM)))
+ {
+ return strdup(dv);
+ }
+ // remember the first pci NIC-card
+ if (strlen(pci) == 0 && dv[0] == 'p' && isdigit(dv[1]))
+ {
+ strcpy(pci, dv);
+ }
+ }
+ }
+ fclose(f);
+ }
+ // return pci NIC-card or nil if no if name
+ return strlen(pci) > 0 ? strdup(pci) : 0L;
+}
+
int
main(int argc, char **argv)
{
@@ -543,6 +587,8 @@ main(int argc, char **argv)
disable_capability_raw();
+ device = get_first_ethernet();
+
while ((ch = getopt(argc, argv, "h?bfDUAqc:w:s:I:V")) != EOF) {
switch(ch) {
case 'b':
@@ -569,6 +615,10 @@ main(int argc, char **argv)
timeout = atoi(optarg);
break;
case 'I':
+ if (device) {
+ free(device);
+ device = NULL;
+ }
device = strdup(optarg);
break;
case 'f':

View File

@ -1,20 +0,0 @@
diff -up iputils-s20101006/clockdiff.c.unused iputils-s20101006/clockdiff.c
--- iputils-s20101006/clockdiff.c.unused 2011-02-09 16:17:33.988298995 +0100
+++ iputils-s20101006/clockdiff.c 2011-02-09 16:17:52.192299138 +0100
@@ -126,7 +126,7 @@ measure(struct sockaddr_in * addr)
int msgcount;
int cc, count;
fd_set ready;
- long sendtime, recvtime, histime, histime1;
+ long sendtime, recvtime, histime;
long min1, min2, diff;
long delta1, delta2;
struct timeval tv1, tout;
@@ -240,7 +240,6 @@ empty:
rtt_sigma = (rtt_sigma *3 + abs(diff-rtt))/4;
msgcount++;
histime = ntohl(((__u32*)(icp+1))[1]);
- histime1 = ntohl(((__u32*)(icp+1))[2]);
/*
* a hosts using a time format different from
* ms. since midnight UT (as per RFC792) should

View File

@ -1,11 +1,11 @@
--- iputils-s20121112/Makefile.orig 2012-11-13 12:35:00.000000000 +0100
+++ iputils-s20121112/Makefile 2012-11-13 12:35:40.515729240 +0100
@@ -18,7 +18,7 @@ USE_CAP=yes
# sysfs support (with libsysfs - deprecated)
USE_SYSFS=no
# IDN support (experimental
-USE_IDN=no
+USE_IDN=yes
--- iputils-s20121121/Makefile.orig 2012-11-22 07:33:01.000000000 +0100
+++ iputils-s20121121/Makefile 2012-11-22 07:33:54.886547891 +0100
@@ -45,7 +45,7 @@
LIB_SYSFS = -lsysfs
endif
# -------------------------------------
# What a pity, all new gccs are buggy and -Werror does not work. Sigh.
-ifneq ($(USE_IDN),no)
+ifneq ($(USE_IDN),yes)
DEF_IDN = -DUSE_IDN
LIB_IDN = -lidn
endif

View File

@ -1,24 +0,0 @@
--- iputils-s20121112/ping.c.orig 2012-11-13 13:29:37.000000000 +0100
+++ iputils-s20121112/ping.c 2012-11-13 14:45:13.235540884 +0100
@@ -122,7 +122,7 @@ main(int argc, char **argv)
u_char *packet;
char *target;
#ifdef USE_IDN
- char *hnamebuf;
+ char *hnamebuf = NULL;
#else
char hnamebuf[MAX_HOSTNAMELEN];
#endif
@@ -263,8 +263,10 @@ main(int argc, char **argv)
#ifdef USE_IDN
int rc;
- free(hnamebuf);
- hnamebuf = NULL;
+ if (hnamebuf) {
+ free(hnamebuf);
+ hnamebuf = NULL;
+ }
rc = idna_to_ascii_lz(target, &idn, 0);
if (rc != IDNA_SUCCESS) {

View File

@ -1,20 +0,0 @@
--- iputils-s20121112/ping.c.orig 2012-11-13 12:54:16.000000000 +0100
+++ iputils-s20121112/ping.c 2012-11-13 12:59:42.800466410 +0100
@@ -314,9 +314,16 @@ main(int argc, char **argv)
}
if (device) {
struct ifreq ifr;
+ int rc;
+
memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_name, device, IFNAMSIZ-1);
- if (setsockopt(probe_fd, SOL_SOCKET, SO_BINDTODEVICE, device, strlen(device)+1) == -1) {
+
+ enable_capability_raw();
+ rc = setsockopt(probe_fd, SOL_SOCKET, SO_BINDTODEVICE, device, strlen(device)+1);
+ disable_capability_raw();
+
+ if (rc == -1) {
if (IN_MULTICAST(ntohl(dst.sin_addr.s_addr))) {
struct ip_mreqn imr;
if (ioctl(probe_fd, SIOCGIFINDEX, &ifr) < 0) {

View File

@ -1,7 +1,7 @@
Summary: Network monitoring tools including ping
Name: iputils
Version: 20121112
Release: 2%{?dist}
Version: 20121121
Release: 1%{?dist}
# some parts are under the original BSD (ping.c)
# some are under GPLv2+ (tracepath.c)
License: BSD and GPLv2+
@ -19,17 +19,8 @@ Patch1: iputils-20020124-countermeasures.patch
Patch3: iputils-20020927-ping-subint.patch
Patch5: iputils-ifenslave.patch
Patch6: iputils-20121112-idn.patch
# Purpose of this patch?
Patch8: iputils-20070202-ia64_align.patch
Patch10: iputils-20071127-corr_type.patch
Patch12: iputils-20100418-convtoint.patch
# Accepted upstream, will be in the next release
Patch15: iputils-20101006-unused.patch
# Use getifaddrs() instead of this?
Patch17: iputils-20101006-eth.patch
# Accepted upstream, will be in the next release
Patch18: iputils-s20121112-sobindtodevice-capability.patch
Patch19: iputils-s20121112-idn-free.patch
BuildRequires: docbook-utils perl-SGMLSpm
BuildRequires: glibc-kernheaders >= 2.4-8.19
@ -72,13 +63,8 @@ The iputils-sysvinit contains SysV initscritps support.
%patch3 -p1 -b .ping-subint
%patch5 -p1 -b .addr
%patch6 -p1 -b .idn
%patch8 -p1 -b .ia64_align
%patch10 -p1 -b .corr_type
%patch12 -p1 -b .convtoint
%patch15 -p1 -b .unused
%patch17 -p1 -b .eth
%patch18 -p1 -b .bindtodevice-cap
%patch19 -p1 -b .idn-free
%build
%ifarch s390 s390x
@ -161,6 +147,9 @@ mv -f RELNOTES.tmp RELNOTES
%{_sysconfdir}/rc.d/init.d/rdisc
%changelog
* Thu Nov 22 2012 Jan Synáček <jsynacek@redhat.com> - 20121121-1
- Update to iputils-s20121121, drop unnecessary patches
* Mon Nov 19 2012 Jan Synáček <jsynacek@redhat.com> - 20121112-2
- Update License field

View File

@ -1,2 +1,2 @@
fe18b8f0ccd4d38c3fa44a18e975a1a5 iputils-s20121112.tar.bz2
7da47744fc3b01c84e2cebd34cbf9e16 iputils-s20121121.tar.bz2
6702c58e970e6a73fc8d9b7c9b63af35 ifenslave.tar.gz