From d0d65fdc0cb89633018dbb50a142232daf5d32d8 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 14 Mar 2017 14:41:35 +0100 Subject: [PATCH 1/3] Rebase package on top of iproute2-4.10.0 --- .gitignore | 1 + ...pages-add-man-page-for-skbmod-action.patch | 58 ------------------- ..._xt-Fix-segfault-with-iptables-1.6.0.patch | 36 ------------ iproute.spec | 32 +++++----- sources | 2 +- 5 files changed, 16 insertions(+), 113 deletions(-) delete mode 100644 0001-Revert-man-pages-add-man-page-for-skbmod-action.patch delete mode 100644 0001-tc-m_xt-Fix-segfault-with-iptables-1.6.0.patch diff --git a/.gitignore b/.gitignore index b6ef565..52ced98 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /iproute2-4.7.0.tar.xz /iproute2-4.8.0.tar.xz /iproute2-4.9.0.tar.xz +/iproute2-4.10.0.tar.xz diff --git a/0001-Revert-man-pages-add-man-page-for-skbmod-action.patch b/0001-Revert-man-pages-add-man-page-for-skbmod-action.patch deleted file mode 100644 index 881d287..0000000 --- a/0001-Revert-man-pages-add-man-page-for-skbmod-action.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 25ee240c3e80b772dc596fc28013a3f0e2291ab3 Mon Sep 17 00:00:00 2001 -From: Jiri Benc -Date: Wed, 18 Jan 2017 13:37:25 +0100 -Subject: [PATCH] Revert "man pages: add man page for skbmod action" -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This reverts commit a40995d1c79e5a1b8711f6cd26eca9807fc4dd50. - -The patch is missing the actual tc-skbmod.8 file which causes 'make -install' to fail: - -install -m 0755 -d /tmp/ip/usr/share/man/man8 -install -m 0644 ip-address.8 ip-link.8 ip-route.8 ip.8 arpd.8 lnstat.8 -routel.8 rtacct.8 rtmon.8 rtpr.8 ss.8 tc.8 tc-bfifo.8 tc-bpf.8 tc-cbq.8 -tc-cbq-details.8 tc-choke.8 tc-codel.8 tc-fq.8 tc-drr.8 tc-ematch.8 -tc-fq_codel.8 tc-hfsc.8 tc-htb.8 tc-pie.8 tc-mqprio.8 tc-netem.8 tc-pfifo.8 -tc-pfifo_fast.8 tc-prio.8 tc-red.8 tc-sfb.8 tc-sfq.8 tc-stab.8 tc-tbf.8 -bridge.8 rtstat.8 ctstat.8 nstat.8 routef.8 ip-addrlabel.8 ip-fou.8 ip-gue.8 -ip-l2tp.8 ip-macsec.8 ip-maddress.8 ip-monitor.8 ip-mroute.8 ip-neighbour.8 -ip-netns.8 ip-ntable.8 ip-rule.8 ip-tunnel.8 ip-xfrm.8 ip-tcp_metrics.8 -ip-netconf.8 ip-token.8 tipc.8 tipc-bearer.8 tipc-link.8 tipc-media.8 -tipc-nametable.8 tipc-node.8 tipc-socket.8 tc-basic.8 tc-cgroup.8 tc-flow.8 -tc-flower.8 tc-fw.8 tc-route.8 tc-tcindex.8 tc-u32.8 tc-matchall.8 -tc-connmark.8 tc-csum.8 tc-mirred.8 tc-nat.8 tc-pedit.8 tc-police.8 -tc-simple.8 tc-skbedit.8 tc-vlan.8 tc-xt.8 tc-ife.8 tc-skbmod.8 -tc-tunnel_key.8 devlink.8 devlink-dev.8 devlink-monitor.8 devlink-port.8 -devlink-sb.8 /tmp/ip/usr/share/man/man8 -install: cannot stat ‘tc-skbmod.8’: No such file or directory -make[2]: *** [install] Error 1 -make[1]: *** [install] Error 2 - -Signed-off-by: Jiri Benc - -Conflicts: - man/man8/Makefile --> Context changes due to missing other new man pages. ---- - man/man8/Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/man/man8/Makefile b/man/man8/Makefile -index de6f249b..4ad96ce4 100644 ---- a/man/man8/Makefile -+++ b/man/man8/Makefile -@@ -16,7 +16,7 @@ MAN8PAGES = $(TARGETS) ip.8 arpd.8 lnstat.8 routel.8 rtacct.8 rtmon.8 rtpr.8 ss. - tc-basic.8 tc-cgroup.8 tc-flow.8 tc-flower.8 tc-fw.8 tc-route.8 \ - tc-tcindex.8 tc-u32.8 tc-matchall.8 \ - tc-connmark.8 tc-csum.8 tc-mirred.8 tc-nat.8 tc-pedit.8 tc-police.8 \ -- tc-simple.8 tc-skbedit.8 tc-vlan.8 tc-xt.8 tc-ife.8 tc-skbmod.8 \ -+ tc-simple.8 tc-skbedit.8 tc-vlan.8 tc-xt.8 tc-ife.8 \ - devlink.8 devlink-dev.8 devlink-monitor.8 devlink-port.8 devlink-sb.8 - - all: $(TARGETS) --- -2.11.0 - diff --git a/0001-tc-m_xt-Fix-segfault-with-iptables-1.6.0.patch b/0001-tc-m_xt-Fix-segfault-with-iptables-1.6.0.patch deleted file mode 100644 index 103a486..0000000 --- a/0001-tc-m_xt-Fix-segfault-with-iptables-1.6.0.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 34ea60b5b7645e96c600b8073dd82ac65144d711 Mon Sep 17 00:00:00 2001 -From: Phil Sutter -Date: Thu, 12 Jan 2017 15:12:26 +0100 -Subject: [iproute PATCH] tc: m_xt: Fix segfault with iptables-1.6.0 - -Said iptables version introduced struct xtables_globals field -'compat_rev', a function pointer. Initializing it is mandatory as -libxtables calls it without existence check. - -Without this, tc segfaults when using the xt action like so: - -| tc filter add dev d0 parent ffff: u32 match u32 0 0 \ -| action xt -j MARK --set-mark 20 - -Signed-off-by: Phil Sutter ---- - tc/m_xt.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/tc/m_xt.c b/tc/m_xt.c -index dbb54981462ee..57ed40d7aa3a8 100644 ---- a/tc/m_xt.c -+++ b/tc/m_xt.c -@@ -77,6 +77,9 @@ static struct xtables_globals tcipt_globals = { - .orig_opts = original_opts, - .opts = original_opts, - .exit_err = NULL, -+#if (XTABLES_VERSION_CODE >= 11) -+ .compat_rev = xtables_compatible_revision, -+#endif - }; - - /* --- -2.11.0 - diff --git a/iproute.spec b/iproute.spec index ce13f45..7cc38a5 100644 --- a/iproute.spec +++ b/iproute.spec @@ -1,30 +1,21 @@ %global cbq_version v0.7.3 Summary: Advanced IP routing and network device configuration tools Name: iproute -Version: 4.9.0 -Release: 4%{?dist} +Version: 4.10.0 +Release: 1%{?dist} Group: Applications/System URL: http://kernel.org/pub/linux/utils/net/%{name}2/ Source0: http://kernel.org/pub/linux/utils/net/%{name}2/%{name}2-%{version}.tar.xz Source1: cbq-0000.example Source2: avpkt -# manpage/help improvements -# -# * Piece by piece absorbed upstream. -# -# https://github.com/pavlix/iproute2/commits/fedora +# Fedora local docs changes: +# - We ship cbq.init-v0.7.3 as cbq binary, so have a cbq.8 man page which links +# to tc-cbq.8. +# - Drop reference to Debian from ss.8 man page. +# - We ship ss.ps instead of ss.html. Patch1: 0001-Documentation-fixes.patch -# Fix for bz#1411127 -# -# Accepted upstream: -# https://patchwork.ozlabs.org/patch/714480/ -Patch2: 0001-tc-m_xt-Fix-segfault-with-iptables-1.6.0.patch - -# Fix 'make install' -Patch3: 0001-Revert-man-pages-add-man-page-for-skbmod-action.patch - License: GPLv2+ and Public Domain BuildRequires: bison BuildRequires: elfutils-libelf-devel @@ -87,8 +78,6 @@ The libnetlink static library. %prep %setup -q -n %{name}2-%{version} %patch1 -p1 -%patch2 -p1 -%patch3 -p1 %build export CFLAGS="%{optflags}" @@ -170,8 +159,15 @@ rm -rf '%{buildroot}%{_docdir}' %{_mandir}/man3/* %{_libdir}/libnetlink.a %{_includedir}/libnetlink.h +%{_includedir}/iproute2/bpf_elf.h %changelog +* Tue Mar 14 2017 Phil Sutter - 4.10.0-1 +- Ship new header iproute2/bpf_elf.h +- Document content of remaining docs fixup patch in spec file +- Drop patches already applied upstream +- New version 4.10.0 + * Fri Feb 10 2017 Fedora Release Engineering - 4.9.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild diff --git a/sources b/sources index b2364b7..72be43e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (iproute2-4.9.0.tar.xz) = 0d974d7c001eac75def0d90b628e432d9847024843d02a6cd27266ff30e3f7a9c874fa91115da74db5f321c2e815b486a847059ca6df3aa8ea49432ffa39a889 +SHA512 (iproute2-4.10.0.tar.xz) = e54477e167455e7ef5da4adc168d63eaa96091b63dc987fffe918cbb005eceed18a62283ca99ee2512dc0e960f47ae21b39ffbe399c1612fd9cea147c34c581b From 63284ad5e99dfd2c7df3ca63ccab601218479ff9 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 17 Mar 2017 22:51:24 +0100 Subject: [PATCH 2/3] Add two fixes to 4.10.0 release from upstream --- 0001-Documentation-fixes.patch | 34 ++++++++++++----- ...rrect-type-when-calling-flower_icmp_.patch | 38 +++++++++++++++++++ ...t-for-valid-type-in-bpf_get_work_dir.patch | 38 +++++++++++++++++++ iproute.spec | 11 +++++- 4 files changed, 111 insertions(+), 10 deletions(-) create mode 100644 0002-tc-flower-use-correct-type-when-calling-flower_icmp_.patch create mode 100644 0003-bpf-test-for-valid-type-in-bpf_get_work_dir.patch diff --git a/0001-Documentation-fixes.patch b/0001-Documentation-fixes.patch index 0a149e6..3269037 100644 --- a/0001-Documentation-fixes.patch +++ b/0001-Documentation-fixes.patch @@ -1,13 +1,26 @@ -diff -Nurp iproute2-4.5.0.orig/man/man8/cbq.8 iproute2-4.5.0/man/man8/cbq.8 ---- iproute2-4.5.0.orig/man/man8/cbq.8 1970-01-01 01:00:00.000000000 +0100 -+++ iproute2-4.5.0/man/man8/cbq.8 2016-03-18 13:17:00.673773197 +0100 +From 2332a21bd43ca69ad38a30109881867b9c5c2ea0 Mon Sep 17 00:00:00 2001 +From: Phil Sutter +Date: Fri, 17 Mar 2017 22:47:27 +0100 +Subject: [PATCH] Documentation fixes + +--- + man/man8/cbq.8 | 1 + + man/man8/ss.8 | 4 ++-- + 2 files changed, 3 insertions(+), 2 deletions(-) + create mode 100644 man/man8/cbq.8 + +diff --git a/man/man8/cbq.8 b/man/man8/cbq.8 +new file mode 100644 +index 00000000..bef35201 +--- /dev/null ++++ b/man/man8/cbq.8 @@ -0,0 +1 @@ +.so man8/tc-cbq.8 -\ No newline at end of file -diff -Nurp iproute2-4.5.0.orig/man/man8/ss.8 iproute2-4.5.0/man/man8/ss.8 ---- iproute2-4.5.0.orig/man/man8/ss.8 2016-03-18 13:16:45.046773197 +0100 -+++ iproute2-4.5.0/man/man8/ss.8 2016-03-18 13:17:05.910773197 +0100 -@@ -136,7 +136,7 @@ Read filter information from FILE. +diff --git a/man/man8/ss.8 b/man/man8/ss.8 +index 4ef11523..3898bdbd 100644 +--- a/man/man8/ss.8 ++++ b/man/man8/ss.8 +@@ -142,7 +142,7 @@ Read filter information from FILE. Each line of FILE is interpreted like single command line option. If FILE is - stdin is used. .TP .B FILTER := [ state STATE-FILTER ] [ EXPRESSION ] @@ -16,7 +29,7 @@ diff -Nurp iproute2-4.5.0.orig/man/man8/ss.8 iproute2-4.5.0/man/man8/ss.8 .SH STATE-FILTER -@@ -191,7 +191,7 @@ Find all local processes connected to X +@@ -197,7 +197,7 @@ Find all local processes connected to X server. 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), @@ -25,3 +38,6 @@ diff -Nurp iproute2-4.5.0.orig/man/man8/ss.8 iproute2-4.5.0/man/man8/ss.8 .br .BR RFC " 793 " - https://tools.ietf.org/rfc/rfc793.txt (TCP states) +-- +2.11.0 + diff --git a/0002-tc-flower-use-correct-type-when-calling-flower_icmp_.patch b/0002-tc-flower-use-correct-type-when-calling-flower_icmp_.patch new file mode 100644 index 0000000..1ca3e04 --- /dev/null +++ b/0002-tc-flower-use-correct-type-when-calling-flower_icmp_.patch @@ -0,0 +1,38 @@ +From 2706951bc0dad80596f172e9197452163bc9e067 Mon Sep 17 00:00:00 2001 +From: Simon Horman +Date: Wed, 8 Feb 2017 13:04:31 +0100 +Subject: [PATCH] tc: flower: use correct type when calling + flower_icmp_attr_type + +Use enum flower_icmp_field rather than bool as type of third parameter +when calling flower_icmp_attr_type. + +Fixes: eb3b5696f163 ("tc: flower: support matching on ICMP type and code") +Signed-off-by: Simon Horman +(cherry picked from commit 81f6e5a7279eaab826ba8b291b98fb2e89df0572) +--- + tc/f_flower.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/tc/f_flower.c b/tc/f_flower.c +index 145a8566..75a3fbbc 100644 +--- a/tc/f_flower.c ++++ b/tc/f_flower.c +@@ -752,10 +752,12 @@ static int flower_print_opt(struct filter_util *qu, FILE *f, + if (nl_type >= 0) + flower_print_port(f, "src_port", tb[nl_type]); + +- nl_type = flower_icmp_attr_type(eth_type, ip_proto, false); ++ nl_type = flower_icmp_attr_type(eth_type, ip_proto, ++ FLOWER_ICMP_FIELD_TYPE); + if (nl_type >= 0) + flower_print_icmp(f, "icmp_type", tb[nl_type]); +- nl_type = flower_icmp_attr_type(eth_type, ip_proto, true); ++ nl_type = flower_icmp_attr_type(eth_type, ip_proto, ++ FLOWER_ICMP_FIELD_CODE); + if (nl_type >= 0) + flower_print_icmp(f, "icmp_code", tb[nl_type]); + +-- +2.11.0 + diff --git a/0003-bpf-test-for-valid-type-in-bpf_get_work_dir.patch b/0003-bpf-test-for-valid-type-in-bpf_get_work_dir.patch new file mode 100644 index 0000000..6b40d60 --- /dev/null +++ b/0003-bpf-test-for-valid-type-in-bpf_get_work_dir.patch @@ -0,0 +1,38 @@ +From 305197a2378ffb581f1eca3ec804f76690be7b5a Mon Sep 17 00:00:00 2001 +From: Daniel Borkmann +Date: Mon, 6 Mar 2017 13:06:00 +0100 +Subject: [PATCH] bpf: test for valid type in bpf_get_work_dir + +Jan-Erik reported an assertion in bpf_prog_to_subdir() failed where +type was BPF_PROG_TYPE_UNSPEC, which is only used in bpf_init_env() +to auto-mount and cache the bpf fs mount point. + +Therefore, make sure when bpf_init_env() is called multiple times +(f.e. eBPF classifier with eBPF action attached) and bpf_mnt_cached +is set already that the type is also valid. In bpf_init_env(), we're +only interested in the mount point and not a type-specific subdir. + +Fixes: e42256699cac ("bpf: make tc's bpf loader generic and move into lib") +Reported-by: Jan-Erik Rediger +Signed-off-by: Daniel Borkmann +(cherry picked from commit 51361a9f1cfca81259c68515cb24fbaace03136a) +--- + lib/bpf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/bpf.c b/lib/bpf.c +index 64e199b3..fef9cfcd 100644 +--- a/lib/bpf.c ++++ b/lib/bpf.c +@@ -596,7 +596,7 @@ static const char *bpf_get_work_dir(enum bpf_prog_type type) + if (bpf_mnt_cached) { + const char *out = mnt; + +- if (out) { ++ if (out && type) { + snprintf(bpf_tmp, sizeof(bpf_tmp), "%s%s/", + out, bpf_prog_to_subdir(type)); + out = bpf_tmp; +-- +2.11.0 + diff --git a/iproute.spec b/iproute.spec index 7cc38a5..80bccdb 100644 --- a/iproute.spec +++ b/iproute.spec @@ -2,7 +2,7 @@ Summary: Advanced IP routing and network device configuration tools Name: iproute Version: 4.10.0 -Release: 1%{?dist} +Release: 2%{?dist} Group: Applications/System URL: http://kernel.org/pub/linux/utils/net/%{name}2/ Source0: http://kernel.org/pub/linux/utils/net/%{name}2/%{name}2-%{version}.tar.xz @@ -16,6 +16,10 @@ Source2: avpkt # - We ship ss.ps instead of ss.html. Patch1: 0001-Documentation-fixes.patch +# upstream fixes for commits in 4.10.0 release +Patch2: 0002-tc-flower-use-correct-type-when-calling-flower_icmp_.patch +Patch3: 0003-bpf-test-for-valid-type-in-bpf_get_work_dir.patch + License: GPLv2+ and Public Domain BuildRequires: bison BuildRequires: elfutils-libelf-devel @@ -78,6 +82,8 @@ The libnetlink static library. %prep %setup -q -n %{name}2-%{version} %patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build export CFLAGS="%{optflags}" @@ -162,6 +168,9 @@ rm -rf '%{buildroot}%{_docdir}' %{_includedir}/iproute2/bpf_elf.h %changelog +* Fri Mar 17 2017 Phil Sutter - 4.10.0-2 +- Add two fixes to 4.10.0 release from upstream. + * Tue Mar 14 2017 Phil Sutter - 4.10.0-1 - Ship new header iproute2/bpf_elf.h - Document content of remaining docs fixup patch in spec file From 7e4e9ce2e4135c7ef949da11542e6bf6a8ba73f9 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Thu, 11 May 2017 23:14:09 +0200 Subject: [PATCH 3/3] don't build docs for module builds to limit dependencies --- iproute.spec | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/iproute.spec b/iproute.spec index 80bccdb..868260b 100644 --- a/iproute.spec +++ b/iproute.spec @@ -2,7 +2,7 @@ Summary: Advanced IP routing and network device configuration tools Name: iproute Version: 4.10.0 -Release: 2%{?dist} +Release: 3%{?dist} Group: Applications/System URL: http://kernel.org/pub/linux/utils/net/%{name}2/ Source0: http://kernel.org/pub/linux/utils/net/%{name}2/%{name}2-%{version}.tar.xz @@ -28,8 +28,9 @@ BuildRequires: iptables-devel >= 1.4.5 BuildRequires: libdb-devel BuildRequires: libmnl-devel BuildRequires: libselinux-devel -BuildRequires: linuxdoc-tools BuildRequires: pkgconfig +%if ! 0%{?_module_build} +BuildRequires: linuxdoc-tools BuildRequires: psutils BuildRequires: tex(cm-super-t1.enc) BuildRequires: tex(dvips) @@ -39,6 +40,7 @@ BuildRequires: tex(fullpage.sty) %if 0%{?fedora} BuildRequires: linux-atm-libs-devel %endif +%endif # For the UsrMove transition period Conflicts: filesystem < 3 Provides: /sbin/ip @@ -62,6 +64,7 @@ The Traffic Control utility manages queueing disciplines, their classes and attached filters and actions. It is the standard tool to configure QoS in Linux. +%if ! 0%{?_module_build} %package doc Summary: Documentation for iproute2 utilities with examples Group: Applications/System @@ -69,6 +72,7 @@ License: GPLv2+ %description doc The iproute documentation contains howtos and examples of settings. +%endif %package devel Summary: iproute development files @@ -91,7 +95,9 @@ export LIBDIR=/%{_libdir} export IPT_LIB_DIR=/%{_lib}/xtables ./configure make %{?_smp_mflags} +%if ! 0%{?_module_build} make -C doc +%endif %install export DESTDIR='%{buildroot}' @@ -153,11 +159,13 @@ rm -rf '%{buildroot}%{_docdir}' %config(noreplace) %{_sysconfdir}/sysconfig/cbq/* %{_datadir}/bash-completion/completions/tc +%if ! 0%{?_module_build} %files doc %{!?_licensedir:%global license %%doc} %license COPYING %doc doc/*.ps %doc examples +%endif %files devel %{!?_licensedir:%global license %%doc} @@ -168,6 +176,9 @@ rm -rf '%{buildroot}%{_docdir}' %{_includedir}/iproute2/bpf_elf.h %changelog +* Thu May 11 2017 Karsten Hopp - 4.10.0-3 +- don't build docs for module builds to limit dependencies + * Fri Mar 17 2017 Phil Sutter - 4.10.0-2 - Add two fixes to 4.10.0 release from upstream.