From 094be68adc26fb33c93db34c7bdfb966590c72e5 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 20 Apr 2014 13:00:27 +0200 Subject: [PATCH] iproute2: Update to 3.14.0. --- iproute2/iproute2.nm | 19 ++-- .../iproute2-2.6.29-IPPROTO_IP_for_SA.patch | 11 --- .../patches/iproute2-2.6.31-tc_modules.patch | 12 --- ...6.39-create-peer-veth-without-a-name.patch | 17 ---- .../patches/iproute2-3.11.0-optflags.patch | 13 +++ iproute2/patches/iproute2-3.11.0-rtt.patch | 31 +++++++ iproute2/patches/iproute2-3.11.0-tc-ok.patch | 91 +++++++++++++++++++ ...route2-3.12.0-lnstat-dump-to-stdout.patch} | 10 +- .../iproute2-3.12.0-lnstat-interval.patch | 34 +++++++ .../patches/iproute2-3.4.0-optflags.patch | 13 --- .../patches/iproute2-3.4.0-sharepath.patch | 24 ----- .../iproute2-3.9.0-IPPROTO_IP_for_SA.patch | 12 +++ iproute2/patches/man-pages.patch | 11 --- 13 files changed, 194 insertions(+), 104 deletions(-) delete mode 100644 iproute2/patches/iproute2-2.6.29-IPPROTO_IP_for_SA.patch delete mode 100644 iproute2/patches/iproute2-2.6.31-tc_modules.patch delete mode 100644 iproute2/patches/iproute2-2.6.39-create-peer-veth-without-a-name.patch create mode 100644 iproute2/patches/iproute2-3.11.0-optflags.patch create mode 100644 iproute2/patches/iproute2-3.11.0-rtt.patch create mode 100644 iproute2/patches/iproute2-3.11.0-tc-ok.patch rename iproute2/patches/{iproute2-2.6.39-lnstat-dump-to-stdout.patch => iproute2-3.12.0-lnstat-dump-to-stdout.patch} (63%) create mode 100644 iproute2/patches/iproute2-3.12.0-lnstat-interval.patch delete mode 100644 iproute2/patches/iproute2-3.4.0-optflags.patch delete mode 100644 iproute2/patches/iproute2-3.4.0-sharepath.patch create mode 100644 iproute2/patches/iproute2-3.9.0-IPPROTO_IP_for_SA.patch diff --git a/iproute2/iproute2.nm b/iproute2/iproute2.nm index 03da2ce18..f11c7a8d7 100644 --- a/iproute2/iproute2.nm +++ b/iproute2/iproute2.nm @@ -4,8 +4,8 @@ ############################################################################### 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 @@ -13,8 +13,8 @@ license = GPLv2+ 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 @@ -24,15 +24,15 @@ sources = %{thisapp}.tar.xz 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} @@ -52,8 +52,8 @@ build %{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 @@ -82,9 +82,6 @@ build # 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. diff --git a/iproute2/patches/iproute2-2.6.29-IPPROTO_IP_for_SA.patch b/iproute2/patches/iproute2-2.6.29-IPPROTO_IP_for_SA.patch deleted file mode 100644 index 48ffcb427..000000000 --- a/iproute2/patches/iproute2-2.6.29-IPPROTO_IP_for_SA.patch +++ /dev/null @@ -1,11 +0,0 @@ -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)); diff --git a/iproute2/patches/iproute2-2.6.31-tc_modules.patch b/iproute2/patches/iproute2-2.6.31-tc_modules.patch deleted file mode 100644 index 0daa17bf8..000000000 --- a/iproute2/patches/iproute2-2.6.31-tc_modules.patch +++ /dev/null @@ -1,12 +0,0 @@ -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 diff --git a/iproute2/patches/iproute2-2.6.39-create-peer-veth-without-a-name.patch b/iproute2/patches/iproute2-2.6.39-create-peer-veth-without-a-name.patch deleted file mode 100644 index b77dd7124..000000000 --- a/iproute2/patches/iproute2-2.6.39-create-peer-veth-without-a-name.patch +++ /dev/null @@ -1,17 +0,0 @@ -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; diff --git a/iproute2/patches/iproute2-3.11.0-optflags.patch b/iproute2/patches/iproute2-3.11.0-optflags.patch new file mode 100644 index 000000000..b5396b539 --- /dev/null +++ b/iproute2/patches/iproute2-3.11.0-optflags.patch @@ -0,0 +1,13 @@ +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 diff --git a/iproute2/patches/iproute2-3.11.0-rtt.patch b/iproute2/patches/iproute2-3.11.0-rtt.patch new file mode 100644 index 000000000..819837434 --- /dev/null +++ b/iproute2/patches/iproute2-3.11.0-rtt.patch @@ -0,0 +1,31 @@ +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) { diff --git a/iproute2/patches/iproute2-3.11.0-tc-ok.patch b/iproute2/patches/iproute2-3.11.0-tc-ok.patch new file mode 100644 index 000000000..fb8a13cc2 --- /dev/null +++ b/iproute2/patches/iproute2-3.11.0-tc-ok.patch @@ -0,0 +1,91 @@ +From 3c4b5a852d5bb9070c7fb4428aa50f2e3e1f6e1b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +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ř +--- + 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/iproute2/patches/iproute2-2.6.39-lnstat-dump-to-stdout.patch b/iproute2/patches/iproute2-3.12.0-lnstat-dump-to-stdout.patch similarity index 63% rename from iproute2/patches/iproute2-2.6.39-lnstat-dump-to-stdout.patch rename to iproute2/patches/iproute2-3.12.0-lnstat-dump-to-stdout.patch index a5b7b6251..d16a4bb26 100644 --- a/iproute2/patches/iproute2-2.6.39-lnstat-dump-to-stdout.patch +++ b/iproute2/patches/iproute2-3.12.0-lnstat-dump-to-stdout.patch @@ -1,13 +1,13 @@ 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: diff --git a/iproute2/patches/iproute2-3.12.0-lnstat-interval.patch b/iproute2/patches/iproute2-3.12.0-lnstat-interval.patch new file mode 100644 index 000000000..b20f07948 --- /dev/null +++ b/iproute2/patches/iproute2-3.12.0-lnstat-interval.patch @@ -0,0 +1,34 @@ +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; + } diff --git a/iproute2/patches/iproute2-3.4.0-optflags.patch b/iproute2/patches/iproute2-3.4.0-optflags.patch deleted file mode 100644 index 1dd23cf3a..000000000 --- a/iproute2/patches/iproute2-3.4.0-optflags.patch +++ /dev/null @@ -1,13 +0,0 @@ -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 diff --git a/iproute2/patches/iproute2-3.4.0-sharepath.patch b/iproute2/patches/iproute2-3.4.0-sharepath.patch deleted file mode 100644 index 2a29677c1..000000000 --- a/iproute2/patches/iproute2-3.4.0-sharepath.patch +++ /dev/null @@ -1,24 +0,0 @@ -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; - } diff --git a/iproute2/patches/iproute2-3.9.0-IPPROTO_IP_for_SA.patch b/iproute2/patches/iproute2-3.9.0-IPPROTO_IP_for_SA.patch new file mode 100644 index 000000000..6c150ecc2 --- /dev/null +++ b/iproute2/patches/iproute2-3.9.0-IPPROTO_IP_for_SA.patch @@ -0,0 +1,12 @@ +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)); diff --git a/iproute2/patches/man-pages.patch b/iproute2/patches/man-pages.patch index 9199e3e1b..94e5bc9ba 100644 --- a/iproute2/patches/man-pages.patch +++ b/iproute2/patches/man-pages.patch @@ -65,14 +65,3 @@ diff -up /dev/null iproute2-2.6.29/man/man8/ifcfg.8 + +.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 iproute­doc)" -+.BR /usr/share/doc/iproute-doc-_VERSION_/ss.ps " (package iproute-doc)" - .SH AUTHOR - .I ss - was written by Alexey Kuznetosv, . -- 2.39.2