From c35ca473097203298a4a132a51edcec5145084de Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Mon, 11 Dec 2017 17:42:14 +0100 Subject: [PATCH] Add missing patch files --- ...ion-cookie-print-out-of-the-stats-if.patch | 50 ++++ ...move-action-cookie-len-from-printout.patch | 31 +++ ...re6-Detect-invalid-encaplimit-values.patch | 31 +++ ...x-inconsistency-in-example-descripti.patch | 34 +++ ...ll-NEXT_ARG_FWD-in-__parse_action_co.patch | 224 ++++++++++++++++++ 0007-ss-remove-duplicate-assignment.patch | 33 +++ ...mpletion-add-missing-classid-keyword.patch | 31 +++ iproute.spec | 5 +- 8 files changed, 438 insertions(+), 1 deletion(-) create mode 100644 0002-tc-move-action-cookie-print-out-of-the-stats-if.patch create mode 100644 0003-tc-remove-action-cookie-len-from-printout.patch create mode 100644 0004-link_gre6-Detect-invalid-encaplimit-values.patch create mode 100644 0005-man-tc-csum.8-Fix-inconsistency-in-example-descripti.patch create mode 100644 0006-tc-util-Don-t-call-NEXT_ARG_FWD-in-__parse_action_co.patch create mode 100644 0007-ss-remove-duplicate-assignment.patch create mode 100644 0008-tc-bash-completion-add-missing-classid-keyword.patch diff --git a/0002-tc-move-action-cookie-print-out-of-the-stats-if.patch b/0002-tc-move-action-cookie-print-out-of-the-stats-if.patch new file mode 100644 index 0000000..28c78a3 --- /dev/null +++ b/0002-tc-move-action-cookie-print-out-of-the-stats-if.patch @@ -0,0 +1,50 @@ +From 06ed8e1fc690683fb1226a23548c81b7032fe7fe Mon Sep 17 00:00:00 2001 +From: Jiri Pirko +Date: Sat, 25 Nov 2017 11:07:56 +0100 +Subject: [PATCH] tc: move action cookie print out of the stats if + +Cookie print was made dependent on show_stats for no good reason. Fix +this bu pushing cookie print ot of the stats if. + +Fixes: fd8b3d2c1b9b ("actions: Add support for user cookies") +Signed-off-by: Jiri Pirko +(cherry picked from commit abff45b8026e24dedfe05376d8fedc1a8fe43402) +--- + tc/m_action.c | 17 ++++++++--------- + 1 file changed, 8 insertions(+), 9 deletions(-) + +diff --git a/tc/m_action.c b/tc/m_action.c +index 402228bbf833d..704708f70aaac 100644 +--- a/tc/m_action.c ++++ b/tc/m_action.c +@@ -302,19 +302,18 @@ static int tc_print_one_action(FILE *f, struct rtattr *arg) + return err; + + if (show_stats && tb[TCA_ACT_STATS]) { +- + fprintf(f, "\tAction statistics:\n"); + print_tcstats2_attr(f, tb[TCA_ACT_STATS], "\t", NULL); +- if (tb[TCA_ACT_COOKIE]) { +- int strsz = RTA_PAYLOAD(tb[TCA_ACT_COOKIE]); +- char b1[strsz * 2 + 1]; +- +- fprintf(f, "\n\tcookie len %d %s ", strsz, +- hexstring_n2a(RTA_DATA(tb[TCA_ACT_COOKIE]), +- strsz, b1, sizeof(b1))); +- } + fprintf(f, "\n"); + } ++ if (tb[TCA_ACT_COOKIE]) { ++ int strsz = RTA_PAYLOAD(tb[TCA_ACT_COOKIE]); ++ char b1[strsz * 2 + 1]; ++ ++ fprintf(f, "\tcookie len %d %s\n", strsz, ++ hexstring_n2a(RTA_DATA(tb[TCA_ACT_COOKIE]), ++ strsz, b1, sizeof(b1))); ++ } + + return 0; + } +-- +2.13.1 + diff --git a/0003-tc-remove-action-cookie-len-from-printout.patch b/0003-tc-remove-action-cookie-len-from-printout.patch new file mode 100644 index 0000000..7ef2fcb --- /dev/null +++ b/0003-tc-remove-action-cookie-len-from-printout.patch @@ -0,0 +1,31 @@ +From 903d2bee8c6f156790758f7e9131490b70475ecd Mon Sep 17 00:00:00 2001 +From: Jiri Pirko +Date: Sat, 25 Nov 2017 11:07:57 +0100 +Subject: [PATCH] tc: remove action cookie len from printout + +Make the output same as input and avoid printout of unnecessary len. + +Suggested-by: Stephen Hemminger +Fixes: fd8b3d2c1b9b ("actions: Add support for user cookies") +Signed-off-by: Jiri Pirko +(cherry picked from commit 81051c60c24ad083cfcb46271e6450675763c722) +--- + tc/m_action.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tc/m_action.c b/tc/m_action.c +index 704708f70aaac..951ca973f4806 100644 +--- a/tc/m_action.c ++++ b/tc/m_action.c +@@ -310,7 +310,7 @@ static int tc_print_one_action(FILE *f, struct rtattr *arg) + int strsz = RTA_PAYLOAD(tb[TCA_ACT_COOKIE]); + char b1[strsz * 2 + 1]; + +- fprintf(f, "\tcookie len %d %s\n", strsz, ++ fprintf(f, "\tcookie %s\n", + hexstring_n2a(RTA_DATA(tb[TCA_ACT_COOKIE]), + strsz, b1, sizeof(b1))); + } +-- +2.13.1 + diff --git a/0004-link_gre6-Detect-invalid-encaplimit-values.patch b/0004-link_gre6-Detect-invalid-encaplimit-values.patch new file mode 100644 index 0000000..af51d99 --- /dev/null +++ b/0004-link_gre6-Detect-invalid-encaplimit-values.patch @@ -0,0 +1,31 @@ +From 6ecadd9b426bb05c31ec92c01e5352ac05d4e676 Mon Sep 17 00:00:00 2001 +From: Phil Sutter +Date: Tue, 28 Nov 2017 16:49:58 +0100 +Subject: [PATCH] link_gre6: Detect invalid encaplimit values + +Looks like a typo: get_u8() returns 0 on success and -1 on error, so the +error checking here was ineffective. + +Fixes: a11b7b71a6eba ("link_gre6: really support encaplimit option") +Signed-off-by: Phil Sutter +(cherry picked from commit 56708ae7c9535859223c5b68097b35bf0fae677c) +--- + ip/link_gre6.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ip/link_gre6.c b/ip/link_gre6.c +index 7d07932a60f01..06dcd6756ec41 100644 +--- a/ip/link_gre6.c ++++ b/ip/link_gre6.c +@@ -364,7 +364,7 @@ get_failed: + } else { + __u8 uval; + +- if (get_u8(&uval, *argv, 0) < -1) ++ if (get_u8(&uval, *argv, 0)) + invarg("invalid ELIM", *argv); + encap_limit = uval; + flags &= ~IP6_TNL_F_IGN_ENCAP_LIMIT; +-- +2.13.1 + diff --git a/0005-man-tc-csum.8-Fix-inconsistency-in-example-descripti.patch b/0005-man-tc-csum.8-Fix-inconsistency-in-example-descripti.patch new file mode 100644 index 0000000..3a7a7ce --- /dev/null +++ b/0005-man-tc-csum.8-Fix-inconsistency-in-example-descripti.patch @@ -0,0 +1,34 @@ +From 04475ab5abc836d24b88622bca50af452be65920 Mon Sep 17 00:00:00 2001 +From: Phil Sutter +Date: Wed, 29 Nov 2017 18:34:09 +0100 +Subject: [PATCH] man: tc-csum.8: Fix inconsistency in example description + +Commit 6bbe5e6290db5 ("man: tc-csum.8: Fix example") changed both source +and destination IP addresses in example code but missed to update the +example's description accordingly. + +Fixes: 6bbe5e6290db5 ("man: tc-csum.8: Fix example") +Signed-off-by: Phil Sutter +(cherry picked from commit 6bf156415a588fa1c975be9a18a1579f63a936a2) +--- + man/man8/tc-csum.8 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/man/man8/tc-csum.8 b/man/man8/tc-csum.8 +index 409ab71791cce..65724b88d0b68 100644 +--- a/man/man8/tc-csum.8 ++++ b/man/man8/tc-csum.8 +@@ -53,8 +53,8 @@ SCTP header + .B SWEETS + These are merely syntactic sugar and ignored internally. + .SH EXAMPLES +-The following performs stateless NAT for incoming packets from 192.168.1.100 to +-new destination 18.52.86.120 (0x12345678 in hex). Assuming these are UDP ++The following performs stateless NAT for incoming packets from 192.0.2.100 to ++new destination 198.51.100.1. Assuming these are UDP + packets, both IP and UDP checksums have to be recalculated: + + .RS +-- +2.13.1 + diff --git a/0006-tc-util-Don-t-call-NEXT_ARG_FWD-in-__parse_action_co.patch b/0006-tc-util-Don-t-call-NEXT_ARG_FWD-in-__parse_action_co.patch new file mode 100644 index 0000000..518108f --- /dev/null +++ b/0006-tc-util-Don-t-call-NEXT_ARG_FWD-in-__parse_action_co.patch @@ -0,0 +1,224 @@ +From 03ce79e357f3afefe8d1409a98b5ae03c611d611 Mon Sep 17 00:00:00 2001 +From: Michal Privoznik +Date: Fri, 8 Dec 2017 11:18:07 +0100 +Subject: [PATCH] tc: util: Don't call NEXT_ARG_FWD() in + __parse_action_control() + +Not all callers want parse_action_control*() to advance the +arguments. For instance act_parse_police() does the argument +advancing itself. + +Fixes: e67aba559581 ("tc: actions: add helpers to parse and print control actions") +Signed-off-by: Michal Privoznik +(cherry picked from commit 3572e01a090a298e2f4c4f796bad6639b652e031) +--- + tc/m_bpf.c | 1 + + tc/m_connmark.c | 1 + + tc/m_csum.c | 1 + + tc/m_gact.c | 10 +++++----- + tc/m_ife.c | 1 + + tc/m_mirred.c | 4 +++- + tc/m_nat.c | 1 + + tc/m_pedit.c | 1 + + tc/m_sample.c | 1 + + tc/m_skbedit.c | 1 + + tc/m_skbmod.c | 1 + + tc/m_tunnel_key.c | 1 + + tc/m_vlan.c | 1 + + tc/tc_util.c | 1 - + 14 files changed, 19 insertions(+), 7 deletions(-) + +diff --git a/tc/m_bpf.c b/tc/m_bpf.c +index e3d0a2b118384..8b091a72951c3 100644 +--- a/tc/m_bpf.c ++++ b/tc/m_bpf.c +@@ -125,6 +125,7 @@ opt_bpf: + + parse_action_control_dflt(&argc, &argv, &parm.action, + false, TC_ACT_PIPE); ++ NEXT_ARG_FWD(); + + if (argc) { + if (matches(*argv, "index") == 0) { +diff --git a/tc/m_connmark.c b/tc/m_connmark.c +index 37d7185415490..47c7a8c2b17e7 100644 +--- a/tc/m_connmark.c ++++ b/tc/m_connmark.c +@@ -82,6 +82,7 @@ parse_connmark(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, + } + + parse_action_control_dflt(&argc, &argv, &sel.action, false, TC_ACT_PIPE); ++ NEXT_ARG_FWD(); + + if (argc) { + if (matches(*argv, "index") == 0) { +diff --git a/tc/m_csum.c b/tc/m_csum.c +index 7b156734f64c5..e1352c0820f69 100644 +--- a/tc/m_csum.c ++++ b/tc/m_csum.c +@@ -124,6 +124,7 @@ parse_csum(struct action_util *a, int *argc_p, + } + + parse_action_control_dflt(&argc, &argv, &sel.action, false, TC_ACT_OK); ++ NEXT_ARG_FWD(); + + if (argc) { + if (matches(*argv, "index") == 0) { +diff --git a/tc/m_gact.c b/tc/m_gact.c +index 38949e903be36..7ea2d431f89f9 100644 +--- a/tc/m_gact.c ++++ b/tc/m_gact.c +@@ -88,14 +88,13 @@ parse_gact(struct action_util *a, int *argc_p, char ***argv_p, + if (argc < 0) + return -1; + +- +- if (matches(*argv, "gact") == 0) { +- argc--; +- argv++; +- } else if (parse_action_control(&argc, &argv, &p.action, false) == -1) { ++ if (matches(*argv, "gact") != 0 && ++ parse_action_control(&argc, &argv, &p.action, false) == -1) { + usage(); /* does not return */ + } + ++ NEXT_ARG_FWD(); ++ + #ifdef CONFIG_GACT_PROB + if (argc > 0) { + if (matches(*argv, "random") == 0) { +@@ -115,6 +114,7 @@ parse_gact(struct action_util *a, int *argc_p, char ***argv_p, + if (parse_action_control(&argc, &argv, + &pp.paction, false) == -1) + usage(); ++ NEXT_ARG_FWD(); + if (get_u16(&pp.pval, *argv, 10)) { + fprintf(stderr, "Illegal probability val 0x%x\n", pp.pval); + return -1; +diff --git a/tc/m_ife.c b/tc/m_ife.c +index 8d0fd31fb9440..34b8e03e7e589 100644 +--- a/tc/m_ife.c ++++ b/tc/m_ife.c +@@ -160,6 +160,7 @@ static int parse_ife(struct action_util *a, int *argc_p, char ***argv_p, + + parse_action_control_dflt(&argc, &argv, &p.action, false, TC_ACT_PIPE); + ++ NEXT_ARG_FWD(); + if (argc) { + if (matches(*argv, "index") == 0) { + NEXT_ARG(); +diff --git a/tc/m_mirred.c b/tc/m_mirred.c +index 2384bda1ff045..b09b016c2ca39 100644 +--- a/tc/m_mirred.c ++++ b/tc/m_mirred.c +@@ -170,8 +170,10 @@ parse_direction(struct action_util *a, int *argc_p, char ***argv_p, + } + + +- if (p.eaction == TCA_EGRESS_MIRROR || p.eaction == TCA_INGRESS_MIRROR) ++ if (p.eaction == TCA_EGRESS_MIRROR || p.eaction == TCA_INGRESS_MIRROR) { + parse_action_control(&argc, &argv, &p.action, false); ++ NEXT_ARG_FWD(); ++ } + + if (argc) { + if (iok && matches(*argv, "index") == 0) { +diff --git a/tc/m_nat.c b/tc/m_nat.c +index 31b68fb6bd784..bb455f080b3a4 100644 +--- a/tc/m_nat.c ++++ b/tc/m_nat.c +@@ -117,6 +117,7 @@ parse_nat(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, struct + + parse_action_control_dflt(&argc, &argv, &sel.action, false, TC_ACT_OK); + ++ NEXT_ARG_FWD(); + if (argc) { + if (matches(*argv, "index") == 0) { + NEXT_ARG(); +diff --git a/tc/m_pedit.c b/tc/m_pedit.c +index 5d89ab1d832ab..3391be95da38c 100644 +--- a/tc/m_pedit.c ++++ b/tc/m_pedit.c +@@ -673,6 +673,7 @@ int parse_pedit(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, + + parse_action_control_dflt(&argc, &argv, &sel.sel.action, false, TC_ACT_OK); + ++ NEXT_ARG_FWD(); + if (argc) { + if (matches(*argv, "index") == 0) { + NEXT_ARG(); +diff --git a/tc/m_sample.c b/tc/m_sample.c +index ff5ee6bd1ef63..31774c0e806b4 100644 +--- a/tc/m_sample.c ++++ b/tc/m_sample.c +@@ -100,6 +100,7 @@ static int parse_sample(struct action_util *a, int *argc_p, char ***argv_p, + + parse_action_control_dflt(&argc, &argv, &p.action, false, TC_ACT_PIPE); + ++ NEXT_ARG_FWD(); + if (argc) { + if (matches(*argv, "index") == 0) { + NEXT_ARG(); +diff --git a/tc/m_skbedit.c b/tc/m_skbedit.c +index aa374fcb33ed9..c41a7bb082dad 100644 +--- a/tc/m_skbedit.c ++++ b/tc/m_skbedit.c +@@ -123,6 +123,7 @@ parse_skbedit(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, + parse_action_control_dflt(&argc, &argv, &sel.action, + false, TC_ACT_PIPE); + ++ NEXT_ARG_FWD(); + if (argc) { + if (matches(*argv, "index") == 0) { + NEXT_ARG(); +diff --git a/tc/m_skbmod.c b/tc/m_skbmod.c +index ba79308ba8354..00318d42642a5 100644 +--- a/tc/m_skbmod.c ++++ b/tc/m_skbmod.c +@@ -125,6 +125,7 @@ static int parse_skbmod(struct action_util *a, int *argc_p, char ***argv_p, + + parse_action_control_dflt(&argc, &argv, &p.action, false, TC_ACT_PIPE); + ++ NEXT_ARG_FWD(); + if (argc) { + if (matches(*argv, "index") == 0) { + NEXT_ARG(); +diff --git a/tc/m_tunnel_key.c b/tc/m_tunnel_key.c +index 1cdd03560c357..2dc91879c2375 100644 +--- a/tc/m_tunnel_key.c ++++ b/tc/m_tunnel_key.c +@@ -175,6 +175,7 @@ static int parse_tunnel_key(struct action_util *a, int *argc_p, char ***argv_p, + parse_action_control_dflt(&argc, &argv, &parm.action, + false, TC_ACT_PIPE); + ++ NEXT_ARG_FWD(); + if (argc) { + if (matches(*argv, "index") == 0) { + NEXT_ARG(); +diff --git a/tc/m_vlan.c b/tc/m_vlan.c +index cccb4996b05f3..0b2966ce82e53 100644 +--- a/tc/m_vlan.c ++++ b/tc/m_vlan.c +@@ -137,6 +137,7 @@ static int parse_vlan(struct action_util *a, int *argc_p, char ***argv_p, + parse_action_control_dflt(&argc, &argv, &parm.action, + false, TC_ACT_PIPE); + ++ NEXT_ARG_FWD(); + if (argc) { + if (matches(*argv, "index") == 0) { + NEXT_ARG(); +diff --git a/tc/tc_util.c b/tc/tc_util.c +index b39e5508235ed..173097d2c28a0 100644 +--- a/tc/tc_util.c ++++ b/tc/tc_util.c +@@ -524,7 +524,6 @@ static int __parse_action_control(int *argc_p, char ***argv_p, int *result_p, + } + result |= jump_cnt; + } +- NEXT_ARG_FWD(); + *argc_p = argc; + *argv_p = argv; + *result_p = result; +-- +2.13.1 + diff --git a/0007-ss-remove-duplicate-assignment.patch b/0007-ss-remove-duplicate-assignment.patch new file mode 100644 index 0000000..4388296 --- /dev/null +++ b/0007-ss-remove-duplicate-assignment.patch @@ -0,0 +1,33 @@ +From 79a9bf3743acb9ebaa22e6f8eaa5a817172cca78 Mon Sep 17 00:00:00 2001 +From: Roman Mashak +Date: Mon, 11 Dec 2017 16:24:31 -0500 +Subject: [PATCH] ss: remove duplicate assignment + +Fixes: 8250bc9ff4e5 ("ss: Unify inet sockets output") +Signed-off-by: Roman Mashak +Signed-off-by: Stephen Hemminger +(cherry picked from commit 9f1a9ae88862f0e5b1beef4bef582be0d8edf3d9) + +Conflicts: + misc/ss.c +-> Context changed due to missing commit 00ac78d39c29f + ("ss: print tcpi_rcv_ssthresh"). +--- + misc/ss.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/misc/ss.c b/misc/ss.c +index 45a0c330ec55f..cc1b930a19bcb 100644 +--- a/misc/ss.c ++++ b/misc/ss.c +@@ -2227,7 +2227,6 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r, + s.sacked = info->tcpi_sacked; + s.fackets = info->tcpi_fackets; + s.reordering = info->tcpi_reordering; +- s.rcv_space = info->tcpi_rcv_space; + s.cwnd = info->tcpi_snd_cwnd; + + if (info->tcpi_snd_ssthresh < 0xFFFF) +-- +2.13.1 + diff --git a/0008-tc-bash-completion-add-missing-classid-keyword.patch b/0008-tc-bash-completion-add-missing-classid-keyword.patch new file mode 100644 index 0000000..d3bbec1 --- /dev/null +++ b/0008-tc-bash-completion-add-missing-classid-keyword.patch @@ -0,0 +1,31 @@ +From 1ac0ee2bae7fc79d7be922832de67f9df68f635f Mon Sep 17 00:00:00 2001 +From: Davide Caratti +Date: Tue, 12 Dec 2017 16:45:15 +0100 +Subject: [PATCH] tc: bash-completion: add missing 'classid' keyword + +users of 'matchall' filter can specify a value for the class id: update +bash-completion accordingly. + +Fixes: b32c0b64fa2b ("tc: bash-completion: Add support for matchall") +Signed-off-by: Davide Caratti +(cherry picked from commit 88b428f03f7c1fa64331105f54d42806cece77be) +--- + bash-completion/tc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/bash-completion/tc b/bash-completion/tc +index 80d12972c8f3c..29bca5d9354d3 100644 +--- a/bash-completion/tc ++++ b/bash-completion/tc +@@ -450,7 +450,7 @@ _tc_filter_options() + return 0 + ;; + matchall) +- _tc_once_attr 'action skip_sw skip_hw' ++ _tc_once_attr 'action classid skip_sw skip_hw' + return 0 + ;; + flower) +-- +2.13.1 + diff --git a/iproute.spec b/iproute.spec index 1746357..67657e9 100644 --- a/iproute.spec +++ b/iproute.spec @@ -2,7 +2,7 @@ Summary: Advanced IP routing and network device configuration tools Name: iproute Version: 4.14.1 -Release: 3%{?dist} +Release: 4%{?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 @@ -167,6 +167,9 @@ rm -rf '%{buildroot}%{_docdir}' %{_includedir}/iproute2/bpf_elf.h %changelog +* Mon Dec 11 2017 Phil Sutter - 4.14.1-4 +- Add missing patch files. + * Mon Dec 11 2017 Phil Sutter - 4.14.1-3 - Add upstream suggested backports. - Make use of %%autosetup macro.