###############################################################################
name = iproute2
-version = 3.5.1
-release = 3
+version = 3.14.0
+release = 1
groups = Networking/Tools
url = http://www.linuxfoundation.org/en/Net:Iproute2
summary = Advanced IP routing and network device configuration tools.
description
- The iproute package contains networking utilities (ip and rtmon, for \
- example) which are designed to use the advanced networking \
+ The iproute package contains networking utilities (ip and rtmon, for
+ example) which are designed to use the advanced networking
capabilities of the Linux 2.4.x and 2.6.x kernel.
end
build
requires
bison
- db4-devel
flex
+ libdb-devel
libnl-devel
linux-atm-devel >= 2.5.1
iptables-devel >= 1.4.19
end
prepare_cmds
- sed -e "s/_VERSION_/%{version}/" -i man/man8/ss.8
+ sed -e "s/^LIBDIR=/LIBDIR?=/" -i Makefile
end
export RPM_OPT_FLAGS = %{CFLAGS}
%{BUILDROOT}%{sysconfdir}/iproute2
# Install binaries.
- for bin in genl/genl ip/{ifcfg,ip,routef,routel,rtmon,rtpr} tc/tc \
- misc/{arpd,ifstat,lnstat,nstat,rtacct,ss}; do
+ for bin in bridge/bridge genl/genl ip/{ifcfg,ip,routef,routel,rtmon,rtpr} \
+ tc/tc misc/{arpd,ifstat,lnstat,nstat,rtacct,ss}; do
install -v -m 755 ${bin} %{BUILDROOT}%{sbindir}
done
ln -svf lnstat %{BUILDROOT}%{sbindir}/ctstat
# Install configuration.
install -v -m 644 etc/iproute2/* %{BUILDROOT}%{sysconfdir}/iproute2
-
- # bridge should be installed as 'br', following upstream
- install -v -m 755 bridge/bridge %{BUILDROOT}%{sbindir}/br
end
# Keep libnetlink.a.
+++ /dev/null
-diff -up iproute2-2.6.29/ip/ipxfrm.c.old iproute2-2.6.29/ip/ipxfrm.c
---- iproute2-2.6.29/ip/ipxfrm.c.old 2009-03-24 23:15:14.000000000 +0100
-+++ iproute2-2.6.29/ip/ipxfrm.c 2009-04-24 09:35:58.203735119 +0200
-@@ -1156,6 +1156,7 @@ static int xfrm_selector_upspec_parse(st
- case IPPROTO_UDP:
- case IPPROTO_SCTP:
- case IPPROTO_DCCP:
-+ case IPPROTO_IP: /* to allow shared SA for different protocols */
- break;
- default:
- fprintf(stderr, "\"sport\" and \"dport\" are invalid with proto=%s\n", strxf_proto(sel->proto));
+++ /dev/null
-diff -up iproute2-2.6.31/Makefile.old iproute2-2.6.31/Makefile
---- iproute2-2.6.31/Makefile.old 2010-01-04 12:46:47.000000000 +0100
-+++ iproute2-2.6.31/Makefile 2010-01-04 12:50:17.396384644 +0100
-@@ -13,7 +13,7 @@ DBM_INCLUDE:=$(ROOTDIR)/usr/include
-
- SHARED_LIBS = y
-
--DEFINES= -DRESOLVE_HOSTNAMES -DLIBDIR=\"$(LIBDIR)\"
-+DEFINES= -DRESOLVE_HOSTNAMES -DLIBDIR=\"$(LIBDIR)\" -DIPT_LIB_DIR=\"$(IPT_LIB_DIR)\"
- ifneq ($(SHARED_LIBS),y)
- DEFINES+= -DNO_SHARED_LIBS
- endif
+++ /dev/null
-diff --git a/ip/.link_veth.c.swp b/ip/.link_veth.c.swp
-deleted file mode 100644
-index e3b5480..0000000
-Binary files a/ip/.link_veth.c.swp and /dev/null differ
-diff --git a/ip/link_veth.c b/ip/link_veth.c
-index 3d19b01..eb0f41e 100644
---- a/ip/link_veth.c
-+++ b/ip/link_veth.c
-@@ -27,7 +27,7 @@ static void usage(void)
- static int veth_parse_opt(struct link_util *lu, int argc, char **argv,
- struct nlmsghdr *hdr)
- {
-- char *name, *type, *link, *dev;
-+ char *name = NULL, *type = NULL, *link = NULL, *dev = NULL;
- int err, len;
- struct rtattr * data;
- int group;
--- /dev/null
+diff --git a/Makefile b/Makefile
+index 95266f5..1876ec4 100644
+--- a/Makefile
++++ b/Makefile
+@@ -34,7 +34,7 @@ CCOPTS = -O2
+ WFLAGS := -Wall -Wstrict-prototypes -Wmissing-prototypes
+ WFLAGS += -Wmissing-declarations -Wold-style-definition
+
+-CFLAGS = $(WFLAGS) $(CCOPTS) -I../include $(DEFINES)
++CFLAGS = $(WFLAGS) $(CCOPTS) -I../include $(DEFINES) $(RPM_OPT_FLAGS)
+ YACCFLAGS = -d -t -v
+
+ SUBDIRS=lib ip tc bridge misc netem genl man
--- /dev/null
+diff --git a/lib/utils.c b/lib/utils.c
+index dae1b51..8a1a65d 100644
+--- a/lib/utils.c
++++ b/lib/utils.c
+@@ -145,7 +145,7 @@ int get_time_rtt(unsigned *val, const char *arg, int *raw)
+ return -1;
+
+ /* extra non-digits */
+- if (!p || p == arg || *p)
++ if (!p || p == arg)
+ return -1;
+
+ /* over/underflow */
+@@ -155,7 +155,7 @@ int get_time_rtt(unsigned *val, const char *arg, int *raw)
+ res = strtoul(arg, &p, 0);
+
+ /* empty string or trailing non-digits */
+- if (!p || p == arg || *p)
++ if (!p || p == arg)
+ return -1;
+
+ /* overflow */
+@@ -165,8 +165,6 @@ int get_time_rtt(unsigned *val, const char *arg, int *raw)
+ t = (double)res;
+ }
+
+- if (p == arg)
+- return -1;
+ *raw = 1;
+
+ if (*p) {
--- /dev/null
+From 3c4b5a852d5bb9070c7fb4428aa50f2e3e1f6e1b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
+Date: Thu, 19 Sep 2013 11:25:49 +0200
+Subject: [PATCH] Confirm success for each tc -batch command
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+If `tc -force -batch' is fed by a controlling program from a pipe,
+it's not possible to recognize when a command has been processes
+successfully.
+
+This patch adds an optional `-OK' option to the tc(8) tool, so `tc
+-force -OK -batch' will print "OK\n" to standard output on each
+successfully completed tc command.
+
+Signed-off-by: Petr Písař <ppisar@redhat.com>
+---
+ man/man8/tc.8 | 8 +++++++-
+ tc/tc.c | 8 +++++++-
+ 2 files changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/man/man8/tc.8 b/man/man8/tc.8
+index e0acfeb..583eae2 100644
+--- a/man/man8/tc.8
++++ b/man/man8/tc.8
+@@ -49,7 +49,7 @@ DEV
+ DEV
+
+ .P
+-.B tc [ -force ] -b\fR[\fIatch\fR] \fB[ filename ]
++.B tc [ -force ] [ -OK ] -b\fR[\fIatch\fR] \fB[ filename ]
+
+ .ti 8
+ .IR FORMAT " := {"
+@@ -440,6 +440,12 @@ First failure will cause termination of tc.
+ don't terminate tc on errors in batch mode.
+ If there were any errors during execution of the commands, the application return code will be non zero.
+
++.TP
++.BR "\-OK"
++in batch mode, print
++.B OK
++and a new line on standard output after each successfully interpreted command.
++
+ .SH HISTORY
+ .B tc
+ was written by Alexey N. Kuznetsov and added in Linux 2.2.
+diff --git a/tc/tc.c b/tc/tc.c
+index 9b50e74..b43bb47 100644
+--- a/tc/tc.c
++++ b/tc/tc.c
+@@ -39,6 +39,7 @@ int batch_mode = 0;
+ int resolve_hosts = 0;
+ int use_iec = 0;
+ int force = 0;
++int ok = 0;
+ struct rtnl_handle rth;
+
+ static void *BODY = NULL; /* cached handle dlopen(NULL) */
+@@ -183,7 +184,7 @@ noexist:
+ static void usage(void)
+ {
+ fprintf(stderr, "Usage: tc [ OPTIONS ] OBJECT { COMMAND | help }\n"
+- " tc [-force] -batch filename\n"
++ " tc [-force] [-OK] -batch filename\n"
+ "where OBJECT := { qdisc | class | filter | action | monitor }\n"
+ " OPTIONS := { -s[tatistics] | -d[etails] | -r[aw] | -p[retty] | -b[atch] [filename] }\n");
+ }
+@@ -251,6 +252,9 @@ static int batch(const char *name)
+ ret = 1;
+ if (!force)
+ break;
++ } else if (ok) {
++ printf("OK\n");
++ fflush(stdout);
+ }
+ }
+ if (line)
+@@ -288,6 +292,8 @@ int main(int argc, char **argv)
+ return 0;
+ } else if (matches(argv[1], "-force") == 0) {
+ ++force;
++ } else if (matches(argv[1], "-OK") == 0) {
++ ++ok;
+ } else if (matches(argv[1], "-batch") == 0) {
+ argc--; argv++;
+ if (argc <= 1)
+--
+1.8.3.1
+
diff --git a/misc/lnstat.c b/misc/lnstat.c
-index 32ab6a4..431bfc7 100644
+index d6415ef..8608cfa 100644
--- a/misc/lnstat.c
+++ b/misc/lnstat.c
-@@ -322,7 +322,7 @@ int main(int argc, char **argv)
- int i;
- struct table_hdr *header;
+@@ -351,7 +351,7 @@ int main(int argc, char **argv)
+
+ switch (mode) {
case MODE_DUMP:
- lnstat_dump(stderr, lnstat_files);
+ lnstat_dump(stdout, lnstat_files);
break;
- case MODE_NORMAL:
+ case MODE_NORMAL:
--- /dev/null
+diff --git a/misc/lnstat.c b/misc/lnstat.c
+index 8608cfa..8e8b1ba 100644
+--- a/misc/lnstat.c
++++ b/misc/lnstat.c
+@@ -253,7 +253,7 @@ int main(int argc, char **argv)
+ MODE_JSON,
+ MODE_NORMAL,
+ } mode = MODE_NORMAL;
+- unsigned long count = 1;
++ unsigned long count = 0;
+ struct table_hdr *header;
+ static struct field_params fp;
+ int num_req_files = 0;
+@@ -366,7 +366,7 @@ int main(int argc, char **argv)
+ if (interval < 1 )
+ interval = 1;
+
+- for (i = 0; i < count; i++) {
++ for (i = 0; i < count || !count; ) {
+ lnstat_update(lnstat_files);
+ if (mode == MODE_JSON)
+ print_json(stdout, lnstat_files, &fp);
+@@ -377,8 +377,10 @@ int main(int argc, char **argv)
+ print_line(stdout, lnstat_files, &fp);
+ }
+ fflush(stdout);
+- if (i < count - 1)
++ if (i < count - 1 || !count)
+ sleep(interval);
++ if (count)
++ ++i;
+ }
+ break;
+ }
+++ /dev/null
-diff --git a/Makefile b/Makefile
-index 1e15c72..945d3b3 100644
---- a/Makefile
-+++ b/Makefile
-@@ -36,7 +36,7 @@ HOSTCC = gcc
- DEFINES += -D_GNU_SOURCE
- CCOPTS = -O2
- WFLAGS = -Wall -Wstrict-prototypes
--CFLAGS = $(WFLAGS) $(CCOPTS) -I../include $(DEFINES)
-+CFLAGS = $(WFLAGS) $(CCOPTS) -I../include $(DEFINES) $(RPM_OPT_FLAGS)
- YACCFLAGS = -d -t -v
-
- SUBDIRS=lib ip tc misc netem genl man
+++ /dev/null
-diff --git a/tc/tc_util.c b/tc/tc_util.c
-index 926ed08..33f6974 100644
---- a/tc/tc_util.c
-+++ b/tc/tc_util.c
-@@ -24,8 +24,8 @@
- #include "utils.h"
- #include "tc_util.h"
-
--#ifndef LIBDIR
--#define LIBDIR "/usr/lib"
-+#ifndef SHAREDIR
-+#define SHAREDIR "/usr/share"
- #endif
-
- const char *get_tc_lib(void)
-@@ -34,7 +34,7 @@ const char *get_tc_lib(void)
-
- lib_dir = getenv("TC_LIB_DIR");
- if (!lib_dir)
-- lib_dir = LIBDIR "/tc/";
-+ lib_dir = SHAREDIR "/tc/";
-
- return lib_dir;
- }
--- /dev/null
+diff --git a/ip/ipxfrm.c b/ip/ipxfrm.c
+index 0495ff4..b1d4c6e 100644
+--- a/ip/ipxfrm.c
++++ b/ip/ipxfrm.c
+@@ -1275,6 +1275,7 @@ static int xfrm_selector_upspec_parse(struct xfrm_selector *sel,
+ case IPPROTO_UDP:
+ case IPPROTO_SCTP:
+ case IPPROTO_DCCP:
++ case IPPROTO_IP: /* to allow shared SA for different protocols */
+ break;
+ default:
+ fprintf(stderr, "\"sport\" and \"dport\" are invalid with PROTO value \"%s\"\n", strxf_proto(sel->proto));
+
+.SH SEE ALSO
+.BR ip-cref.dvi
---- iproute2-2.6.35/man/man8/ss.8 2010-08-04 19:45:59.000000000 +0200
-+++ iproute2-2.6.35/man/man8/ss.8.new 2010-10-11 14:47:06.084216018 +0200
-@@ -114,7 +114,7 @@
- List all the tcp sockets in state FIN-WAIT-1 for our apache to network 193.233.7/24 and look at their timers.
- .SH SEE ALSO
- .BR ip (8),
--.BR /usr/share/doc/iproute-doc/ss.html " (package iproutedoc)"
-+.BR /usr/share/doc/iproute-doc-_VERSION_/ss.ps " (package iproute-doc)"
- .SH AUTHOR
- .I ss
- was written by Alexey Kuznetosv, <kuznet@ms2.inr.ac.ru>.