From ae59d604a29cfb2662e8c37176c3d56569e02fe5 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 1 Feb 2019 11:14:04 +0100 Subject: [PATCH] Rebase package on top of iproute2-4.20.0 --- 0001-Add-cbq.8-as-an-alias-to-tc-cbq.8.patch | 21 -- ...-fix-typo-in-check_xt_old_internal_h.patch | 30 +++ 0002-man-ss.8-more-line-breaks.patch | 47 ++++ 0002-ss-Review-ssfilter.patch | 130 ---------- 0003-man-tc-taprio.8-fix-syntax-error.patch | 34 +++ ...Fix-typo-in-check-for-colored-output.patch | 33 --- ...-bridge-Fix-check-for-colored-output.patch | 35 --- ...ode-for-conditionally-colored-output.patch | 97 -------- 0006-Make-colored-output-configurable.patch | 233 ------------------ ...ke-check_enable_color-return-boolean.patch | 59 ----- ...iprule-Fix-destination-prefix-output.patch | 40 --- ...rify-referenced-versions-are-Linux-o.patch | 132 ---------- avpkt | 1 - cbq-0000.example | 5 - iproute.spec | 68 ++--- 15 files changed, 128 insertions(+), 837 deletions(-) delete mode 100644 0001-Add-cbq.8-as-an-alias-to-tc-cbq.8.patch create mode 100644 0001-configure-fix-typo-in-check_xt_old_internal_h.patch create mode 100644 0002-man-ss.8-more-line-breaks.patch delete mode 100644 0002-ss-Review-ssfilter.patch create mode 100644 0003-man-tc-taprio.8-fix-syntax-error.patch delete mode 100644 0003-tc-Fix-typo-in-check-for-colored-output.patch delete mode 100644 0004-bridge-Fix-check-for-colored-output.patch delete mode 100644 0005-Merge-common-code-for-conditionally-colored-output.patch delete mode 100644 0006-Make-colored-output-configurable.patch delete mode 100644 0007-lib-Make-check_enable_color-return-boolean.patch delete mode 100644 0008-iprule-Fix-destination-prefix-output.patch delete mode 100644 0009-man-ip-route-Clarify-referenced-versions-are-Linux-o.patch delete mode 100644 avpkt delete mode 100644 cbq-0000.example diff --git a/0001-Add-cbq.8-as-an-alias-to-tc-cbq.8.patch b/0001-Add-cbq.8-as-an-alias-to-tc-cbq.8.patch deleted file mode 100644 index ac33332..0000000 --- a/0001-Add-cbq.8-as-an-alias-to-tc-cbq.8.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 9c27b875aef25848adbebc8d13525bef3ec2ba45 Mon Sep 17 00:00:00 2001 -From: Phil Sutter -Date: Fri, 17 Mar 2017 22:47:27 +0100 -Subject: [PATCH] Add cbq.8 as an alias to tc-cbq.8 - -Signed-off-by: Phil Sutter ---- - man/man8/cbq.8 | 1 + - 1 file changed, 1 insertion(+) - create mode 100644 man/man8/cbq.8 - -diff --git a/man/man8/cbq.8 b/man/man8/cbq.8 -new file mode 100644 -index 0000000000000..bef35201f4eab ---- /dev/null -+++ b/man/man8/cbq.8 -@@ -0,0 +1 @@ -+.so man8/tc-cbq.8 --- -2.18.0 - diff --git a/0001-configure-fix-typo-in-check_xt_old_internal_h.patch b/0001-configure-fix-typo-in-check_xt_old_internal_h.patch new file mode 100644 index 0000000..5f57dd2 --- /dev/null +++ b/0001-configure-fix-typo-in-check_xt_old_internal_h.patch @@ -0,0 +1,30 @@ +From 00e0e82a31cede883b2784f08377008c3e996857 Mon Sep 17 00:00:00 2001 +From: "Dmitry V. Levin" +Date: Tue, 8 Jan 2019 01:37:15 +0300 +Subject: [PATCH] configure: fix typo in check_xt_old_internal_h + +Fixes: 377a09902a57 ("configure: Minor code cleanup") +Signed-off-by: Dmitry V. Levin +Signed-off-by: Stephen Hemminger +(cherry picked from commit db4ad742e196a3d76cd72ae1257bf444584fa5c5) +Signed-off-by: Phil Sutter +--- + configure | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure b/configure +index b85eb58b2ba9e..45fcffb69bb53 100755 +--- a/configure ++++ b/configure +@@ -115,7 +115,7 @@ EOF + check_xt_old_internal_h() + { + # bail if previous XT checks has already succeeded. +- grep -q if grep -q TC_CONFIG_XT $CONFIG && return ++ grep -q TC_CONFIG_XT $CONFIG && return + + #check if we need our own internal.h + cat >$TMPDIR/ipttest.c < +Date: Sat, 12 Jan 2019 12:28:54 +0000 +Subject: [PATCH] man: ss.8: more line breaks + +groff stiff complains about unbreakable lines: + 96: warning [p 2, 3.0i]: can't break line + +Indent it some more. + +Fixes: 7f5047524c99 ("man: ss.8: break and indent long line") + +Signed-off-by: Luca Boccassi +Signed-off-by: Stephen Hemminger +(cherry picked from commit cffeeb39466bdfcead182138e1f4c6881384ab16) +Signed-off-by: Phil Sutter +--- + man/man8/ss.8 | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/man/man8/ss.8 b/man/man8/ss.8 +index f138c91a1fcc4..553a6cf46f0e2 100644 +--- a/man/man8/ss.8 ++++ b/man/man8/ss.8 +@@ -89,11 +89,17 @@ an uuid of the socket + Show socket memory usage. The output format is: + .RS + .P +-skmem:(r,rb,t,tb,f, ++skmem:(r,rb,t,tb, + .br + .RS + .RS +-w,o,bl) ++f,w, ++.RE ++.RE ++.br ++.RS ++.RS ++o,bl) + .RE + .RE + .P +-- +2.20.1 + diff --git a/0002-ss-Review-ssfilter.patch b/0002-ss-Review-ssfilter.patch deleted file mode 100644 index eda0c52..0000000 --- a/0002-ss-Review-ssfilter.patch +++ /dev/null @@ -1,130 +0,0 @@ -From 45ef10dd7b9d4337bfef9573803c1c7cadc012e6 Mon Sep 17 00:00:00 2001 -From: Phil Sutter -Date: Tue, 14 Aug 2018 14:18:06 +0200 -Subject: [PATCH] ss: Review ssfilter - -The original problem was ssfilter rejecting single expressions if -enclosed in braces, such as: - -| sport = 22 or ( dport = 22 ) - -This is fixed by allowing 'expr' to be an 'exprlist' enclosed in braces. -The no longer required recursion in 'exprlist' being an 'exprlist' -enclosed in braces is dropped. - -In addition to that, a few other things are changed: - -* Remove pointless 'null' prefix in 'appled' before 'exprlist'. -* For simple equals matches, '=' operator was required for ports but not - allowed for hosts. Make this consistent by making '=' operator - optional in both cases. - -Reported-by: Samuel Mannehed -Fixes: b2038cc0b2403 ("ssfilter: Eliminate shift/reduce conflicts") -Signed-off-by: Phil Sutter -Signed-off-by: Stephen Hemminger -(cherry picked from commit 38d209ecf2ae966b9b25de4acb60cdffb0e06ced) -Signed-off-by: Phil Sutter ---- - misc/ssfilter.y | 36 +++++++++++++++++++++--------------- - 1 file changed, 21 insertions(+), 15 deletions(-) - -diff --git a/misc/ssfilter.y b/misc/ssfilter.y -index 88d4229a9b241..0413dddaa7584 100644 ---- a/misc/ssfilter.y -+++ b/misc/ssfilter.y -@@ -42,24 +42,22 @@ static void yyerror(char *s) - %nonassoc '!' - - %% --applet: null exprlist -+applet: exprlist - { -- *yy_ret = $2; -- $$ = $2; -+ *yy_ret = $1; -+ $$ = $1; - } - | null - ; -+ - null: /* NOTHING */ { $$ = NULL; } - ; -+ - exprlist: expr - | '!' expr - { - $$ = alloc_node(SSF_NOT, $2); - } -- | '(' exprlist ')' -- { -- $$ = $2; -- } - | exprlist '|' expr - { - $$ = alloc_node(SSF_OR, $1); -@@ -77,13 +75,21 @@ exprlist: expr - } - ; - --expr: DCOND HOSTCOND -+eq: '=' -+ | /* nothing */ -+ ; -+ -+expr: '(' exprlist ')' -+ { -+ $$ = $2; -+ } -+ | DCOND eq HOSTCOND - { -- $$ = alloc_node(SSF_DCOND, $2); -+ $$ = alloc_node(SSF_DCOND, $3); - } -- | SCOND HOSTCOND -+ | SCOND eq HOSTCOND - { -- $$ = alloc_node(SSF_SCOND, $2); -+ $$ = alloc_node(SSF_SCOND, $3); - } - | DPORT GEQ HOSTCOND - { -@@ -101,7 +107,7 @@ expr: DCOND HOSTCOND - { - $$ = alloc_node(SSF_NOT, alloc_node(SSF_D_GE, $3)); - } -- | DPORT '=' HOSTCOND -+ | DPORT eq HOSTCOND - { - $$ = alloc_node(SSF_DCOND, $3); - } -@@ -126,7 +132,7 @@ expr: DCOND HOSTCOND - { - $$ = alloc_node(SSF_NOT, alloc_node(SSF_S_GE, $3)); - } -- | SPORT '=' HOSTCOND -+ | SPORT eq HOSTCOND - { - $$ = alloc_node(SSF_SCOND, $3); - } -@@ -134,7 +140,7 @@ expr: DCOND HOSTCOND - { - $$ = alloc_node(SSF_NOT, alloc_node(SSF_SCOND, $3)); - } -- | DEVNAME '=' DEVCOND -+ | DEVNAME eq DEVCOND - { - $$ = alloc_node(SSF_DEVCOND, $3); - } -@@ -142,7 +148,7 @@ expr: DCOND HOSTCOND - { - $$ = alloc_node(SSF_NOT, alloc_node(SSF_DEVCOND, $3)); - } -- | FWMARK '=' MARKMASK -+ | FWMARK eq MARKMASK - { - $$ = alloc_node(SSF_MARKMASK, $3); - } --- -2.18.0 - diff --git a/0003-man-tc-taprio.8-fix-syntax-error.patch b/0003-man-tc-taprio.8-fix-syntax-error.patch new file mode 100644 index 0000000..af6dfab --- /dev/null +++ b/0003-man-tc-taprio.8-fix-syntax-error.patch @@ -0,0 +1,34 @@ +From 06dfededed954e6d98450ae8f57d561359f2430e Mon Sep 17 00:00:00 2001 +From: Luca Boccassi +Date: Sat, 12 Jan 2019 12:28:55 +0000 +Subject: [PATCH] man: tc-taprio.8: fix syntax error + +.Q does not exist so groff complains and the "queues" word is actually +not displayed. + +Fixes: 579acb4bc52f ("taprio: Add manpage for tc-taprio(8)") + +Signed-off-by: Luca Boccassi +Signed-off-by: Stephen Hemminger +(cherry picked from commit 8242808ced032d56d690ae66a93fa52e8d0ada9a) +Signed-off-by: Phil Sutter +--- + man/man8/tc-taprio.8 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/man/man8/tc-taprio.8 b/man/man8/tc-taprio.8 +index 92055b434b942..850be9b036491 100644 +--- a/man/man8/tc-taprio.8 ++++ b/man/man8/tc-taprio.8 +@@ -45,7 +45,7 @@ How traffic is mapped to different hardware queues is similar to + and so the + .B map + and +-.Q queues ++.B queues + parameters have the same meaning. + + The other parameters specify the schedule, and at what point in time +-- +2.20.1 + diff --git a/0003-tc-Fix-typo-in-check-for-colored-output.patch b/0003-tc-Fix-typo-in-check-for-colored-output.patch deleted file mode 100644 index 46a2093..0000000 --- a/0003-tc-Fix-typo-in-check-for-colored-output.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 1824d687058b2c818ae057321d7ca67de46b0fbb Mon Sep 17 00:00:00 2001 -From: Phil Sutter -Date: Wed, 15 Aug 2018 18:21:24 +0200 -Subject: [PATCH] tc: Fix typo in check for colored output - -The check used binary instead of boolean AND, which means colored output -was enabled only if the number of specified '-color' flags was odd. - -Fixes: 2d165c0811058 ("tc: implement color output") -Signed-off-by: Phil Sutter -Signed-off-by: David Ahern -(cherry picked from commit 0d0e0e0bef68f888bedb8d8f343baa943207dafc) -Signed-off-by: Phil Sutter ---- - tc/tc.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tc/tc.c b/tc/tc.c -index 3bb5910ffac52..3bb893756f40e 100644 ---- a/tc/tc.c -+++ b/tc/tc.c -@@ -515,7 +515,7 @@ int main(int argc, char **argv) - - _SL_ = oneline ? "\\" : "\n"; - -- if (color & !json) -+ if (color && !json) - enable_color(); - - if (batch_file) --- -2.18.0 - diff --git a/0004-bridge-Fix-check-for-colored-output.patch b/0004-bridge-Fix-check-for-colored-output.patch deleted file mode 100644 index 696afaa..0000000 --- a/0004-bridge-Fix-check-for-colored-output.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 02a126e40fce4fe03fdc9ce39bd3d9ff20dd1fb0 Mon Sep 17 00:00:00 2001 -From: Phil Sutter -Date: Wed, 15 Aug 2018 18:21:25 +0200 -Subject: [PATCH] bridge: Fix check for colored output - -There is no point in calling enable_color() conditionally if it was -already called for each time '-color' flag was parsed. Align the -algorithm with that in ip and tc by actually making use of 'color' -variable. - -Fixes: e9625d6aead11 ("Merge branch 'iproute2-master' into iproute2-next") -Signed-off-by: Phil Sutter -Signed-off-by: David Ahern -(cherry picked from commit 5332148debeadcf52cc157ef1dd0a377dd482517) -Signed-off-by: Phil Sutter ---- - bridge/bridge.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/bridge/bridge.c b/bridge/bridge.c -index 7fcfe1116f6e5..289a157d37f03 100644 ---- a/bridge/bridge.c -+++ b/bridge/bridge.c -@@ -174,7 +174,7 @@ main(int argc, char **argv) - if (netns_switch(argv[1])) - exit(-1); - } else if (matches(opt, "-color") == 0) { -- enable_color(); -+ ++color; - } else if (matches(opt, "-compressvlans") == 0) { - ++compress_vlans; - } else if (matches(opt, "-force") == 0) { --- -2.18.0 - diff --git a/0005-Merge-common-code-for-conditionally-colored-output.patch b/0005-Merge-common-code-for-conditionally-colored-output.patch deleted file mode 100644 index 58509b4..0000000 --- a/0005-Merge-common-code-for-conditionally-colored-output.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 9aef957dfc6c46468b6469d4e0e275011546753b Mon Sep 17 00:00:00 2001 -From: Phil Sutter -Date: Wed, 15 Aug 2018 18:21:26 +0200 -Subject: [PATCH] Merge common code for conditionally colored output - -Instead of calling enable_color() conditionally with identical check in -three places, introduce check_enable_color() which does it in one place. - -Signed-off-by: Phil Sutter -Signed-off-by: David Ahern -(cherry picked from commit 4d82962cccc6a6b543fa2110e81621c51441f0dd) -Signed-off-by: Phil Sutter ---- - bridge/bridge.c | 3 +-- - include/color.h | 1 + - ip/ip.c | 3 +-- - lib/color.c | 9 +++++++++ - tc/tc.c | 3 +-- - 5 files changed, 13 insertions(+), 6 deletions(-) - -diff --git a/bridge/bridge.c b/bridge/bridge.c -index 289a157d37f03..451d684e0bcfd 100644 ---- a/bridge/bridge.c -+++ b/bridge/bridge.c -@@ -200,8 +200,7 @@ main(int argc, char **argv) - - _SL_ = oneline ? "\\" : "\n"; - -- if (color && !json) -- enable_color(); -+ check_enable_color(color, json); - - if (batch_file) - return batch(batch_file); -diff --git a/include/color.h b/include/color.h -index c80359d3e2e95..4f2c918db7e43 100644 ---- a/include/color.h -+++ b/include/color.h -@@ -13,6 +13,7 @@ enum color_attr { - }; - - void enable_color(void); -+int check_enable_color(int color, int json); - void set_color_palette(void); - int color_fprintf(FILE *fp, enum color_attr attr, const char *fmt, ...); - enum color_attr ifa_family_color(__u8 ifa_family); -diff --git a/ip/ip.c b/ip/ip.c -index 71d5170c0cc23..38eac5ec1e17d 100644 ---- a/ip/ip.c -+++ b/ip/ip.c -@@ -304,8 +304,7 @@ int main(int argc, char **argv) - - _SL_ = oneline ? "\\" : "\n"; - -- if (color && !json) -- enable_color(); -+ check_enable_color(color, json); - - if (batch_file) - return batch(batch_file); -diff --git a/lib/color.c b/lib/color.c -index da1f516cb2492..edf96e5c6ecd7 100644 ---- a/lib/color.c -+++ b/lib/color.c -@@ -77,6 +77,15 @@ void enable_color(void) - set_color_palette(); - } - -+int check_enable_color(int color, int json) -+{ -+ if (color && !json) { -+ enable_color(); -+ return 0; -+ } -+ return 1; -+} -+ - void set_color_palette(void) - { - char *p = getenv("COLORFGBG"); -diff --git a/tc/tc.c b/tc/tc.c -index 3bb893756f40e..e775550174473 100644 ---- a/tc/tc.c -+++ b/tc/tc.c -@@ -515,8 +515,7 @@ int main(int argc, char **argv) - - _SL_ = oneline ? "\\" : "\n"; - -- if (color && !json) -- enable_color(); -+ check_enable_color(color, json); - - if (batch_file) - return batch(batch_file); --- -2.18.0 - diff --git a/0006-Make-colored-output-configurable.patch b/0006-Make-colored-output-configurable.patch deleted file mode 100644 index a65b06d..0000000 --- a/0006-Make-colored-output-configurable.patch +++ /dev/null @@ -1,233 +0,0 @@ -From 889c7c942e23c77118ed5cdb610f53c13a5bfea8 Mon Sep 17 00:00:00 2001 -From: Phil Sutter -Date: Fri, 17 Aug 2018 18:38:45 +0200 -Subject: [PATCH] Make colored output configurable - -Allow for -color={never,auto,always} to have colored output disabled, -enabled only if stdout is a terminal or enabled regardless of stdout -state. - -Signed-off-by: Phil Sutter -Reviewed-by: David Ahern -Signed-off-by: Stephen Hemminger -(cherry picked from commit ff1ab8edf827f55b86c6487c90b7454975d52236) -Signed-off-by: Phil Sutter ---- - bridge/bridge.c | 3 +-- - include/color.h | 9 +++++++++ - ip/ip.c | 3 +-- - lib/color.c | 33 ++++++++++++++++++++++++++++++++- - man/man8/bridge.8 | 13 +++++++++++-- - man/man8/ip.8 | 13 +++++++++++-- - man/man8/tc.8 | 13 +++++++++++-- - tc/tc.c | 3 +-- - 8 files changed, 77 insertions(+), 13 deletions(-) - -diff --git a/bridge/bridge.c b/bridge/bridge.c -index 451d684e0bcfd..263fa5397a623 100644 ---- a/bridge/bridge.c -+++ b/bridge/bridge.c -@@ -173,8 +173,7 @@ main(int argc, char **argv) - NEXT_ARG(); - if (netns_switch(argv[1])) - exit(-1); -- } else if (matches(opt, "-color") == 0) { -- ++color; -+ } else if (matches_color(opt, &color)) { - } else if (matches(opt, "-compressvlans") == 0) { - ++compress_vlans; - } else if (matches(opt, "-force") == 0) { -diff --git a/include/color.h b/include/color.h -index 4f2c918db7e43..a22a00c2277e0 100644 ---- a/include/color.h -+++ b/include/color.h -@@ -2,6 +2,8 @@ - #ifndef __COLOR_H__ - #define __COLOR_H__ 1 - -+#include -+ - enum color_attr { - COLOR_IFNAME, - COLOR_MAC, -@@ -12,8 +14,15 @@ enum color_attr { - COLOR_NONE - }; - -+enum color_opt { -+ COLOR_OPT_NEVER = 0, -+ COLOR_OPT_AUTO = 1, -+ COLOR_OPT_ALWAYS = 2 -+}; -+ - void enable_color(void); - int check_enable_color(int color, int json); -+bool matches_color(const char *arg, int *val); - void set_color_palette(void); - int color_fprintf(FILE *fp, enum color_attr attr, const char *fmt, ...); - enum color_attr ifa_family_color(__u8 ifa_family); -diff --git a/ip/ip.c b/ip/ip.c -index 38eac5ec1e17d..4fe471d99dc97 100644 ---- a/ip/ip.c -+++ b/ip/ip.c -@@ -283,8 +283,7 @@ int main(int argc, char **argv) - exit(-1); - } - rcvbuf = size; -- } else if (matches(opt, "-color") == 0) { -- ++color; -+ } else if (matches_color(opt, &color)) { - } else if (matches(opt, "-help") == 0) { - usage(); - } else if (matches(opt, "-netns") == 0) { -diff --git a/lib/color.c b/lib/color.c -index edf96e5c6ecd7..9c9023587748f 100644 ---- a/lib/color.c -+++ b/lib/color.c -@@ -3,11 +3,13 @@ - #include - #include - #include -+#include - #include - #include - #include - - #include "color.h" -+#include "utils.h" - - enum color { - C_RED, -@@ -79,13 +81,42 @@ void enable_color(void) - - int check_enable_color(int color, int json) - { -- if (color && !json) { -+ if (json || color == COLOR_OPT_NEVER) -+ return 1; -+ -+ if (color == COLOR_OPT_ALWAYS || isatty(fileno(stdout))) { - enable_color(); - return 0; - } - return 1; - } - -+bool matches_color(const char *arg, int *val) -+{ -+ char *dup, *p; -+ -+ if (!val) -+ return false; -+ -+ dup = strdupa(arg); -+ p = strchrnul(dup, '='); -+ if (*p) -+ *(p++) = '\0'; -+ -+ if (matches(dup, "-color")) -+ return false; -+ -+ if (*p == '\0' || !strcmp(p, "always")) -+ *val = COLOR_OPT_ALWAYS; -+ else if (!strcmp(p, "auto")) -+ *val = COLOR_OPT_AUTO; -+ else if (!strcmp(p, "never")) -+ *val = COLOR_OPT_NEVER; -+ else -+ return false; -+ return true; -+} -+ - void set_color_palette(void) - { - char *p = getenv("COLORFGBG"); -diff --git a/man/man8/bridge.8 b/man/man8/bridge.8 -index e7f7148315e19..9684169844f36 100644 ---- a/man/man8/bridge.8 -+++ b/man/man8/bridge.8 -@@ -170,8 +170,17 @@ If there were any errors during execution of the commands, the application - return code will be non zero. - - .TP --.BR "\-c" , " -color" --Use color output. -+.BR \-c [ color ][ = { always | auto | never } -+Configure color output. If parameter is omitted or -+.BR always , -+color output is enabled regardless of stdout state. If parameter is -+.BR auto , -+stdout is checked to be a terminal before enabling color output. If parameter is -+.BR never , -+color output is disabled. If specified multiple times, the last one takes -+precedence. This flag is ignored if -+.B \-json -+is also given. - - .TP - .BR "\-j", " \-json" -diff --git a/man/man8/ip.8 b/man/man8/ip.8 -index 0087d18b74706..1d358879ec39c 100644 ---- a/man/man8/ip.8 -+++ b/man/man8/ip.8 -@@ -187,8 +187,17 @@ to - executes specified command over all objects, it depends if command supports this option. - - .TP --.BR "\-c" , " -color" --Use color output. -+.BR \-c [ color ][ = { always | auto | never } -+Configure color output. If parameter is omitted or -+.BR always , -+color output is enabled regardless of stdout state. If parameter is -+.BR auto , -+stdout is checked to be a terminal before enabling color output. If parameter is -+.BR never , -+color output is disabled. If specified multiple times, the last one takes -+precedence. This flag is ignored if -+.B \-json -+is also given. - - .TP - .BR "\-t" , " \-timestamp" -diff --git a/man/man8/tc.8 b/man/man8/tc.8 -index 840880fbdba63..a5849a776c592 100644 ---- a/man/man8/tc.8 -+++ b/man/man8/tc.8 -@@ -729,8 +729,17 @@ option was specified. Classes can be filtered only by - option. - - .TP --.BR "\ -color" --Use color output. -+.BR \-c [ color ][ = { always | auto | never } -+Configure color output. If parameter is omitted or -+.BR always , -+color output is enabled regardless of stdout state. If parameter is -+.BR auto , -+stdout is checked to be a terminal before enabling color output. If parameter is -+.BR never , -+color output is disabled. If specified multiple times, the last one takes -+precedence. This flag is ignored if -+.B \-json -+is also given. - - .TP - .BR "\-j", " \-json" -diff --git a/tc/tc.c b/tc/tc.c -index e775550174473..586db30cb87c2 100644 ---- a/tc/tc.c -+++ b/tc/tc.c -@@ -493,8 +493,7 @@ int main(int argc, char **argv) - matches(argv[1], "-conf") == 0) { - NEXT_ARG(); - conf_file = argv[1]; -- } else if (matches(argv[1], "-color") == 0) { -- ++color; -+ } else if (matches_color(argv[1], &color)) { - } else if (matches(argv[1], "-timestamp") == 0) { - timestamp++; - } else if (matches(argv[1], "-tshort") == 0) { --- -2.18.0 - diff --git a/0007-lib-Make-check_enable_color-return-boolean.patch b/0007-lib-Make-check_enable_color-return-boolean.patch deleted file mode 100644 index b80f49c..0000000 --- a/0007-lib-Make-check_enable_color-return-boolean.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 028f717e06d8496e15de6c4eaef3ecd88bd9c8d0 Mon Sep 17 00:00:00 2001 -From: Phil Sutter -Date: Fri, 17 Aug 2018 18:38:46 +0200 -Subject: [PATCH] lib: Make check_enable_color() return boolean - -As suggested, turn return code into true/false although it's not checked -anywhere yet. - -Fixes: 4d82962cccc6a ("Merge common code for conditionally colored output") -Signed-off-by: Phil Sutter -Signed-off-by: Stephen Hemminger -(cherry picked from commit 515a766cd29bbed8a180733e93bc8590b001cad7) -Signed-off-by: Phil Sutter ---- - include/color.h | 2 +- - lib/color.c | 8 ++++---- - 2 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/include/color.h b/include/color.h -index a22a00c2277e0..e30f28c51c844 100644 ---- a/include/color.h -+++ b/include/color.h -@@ -21,7 +21,7 @@ enum color_opt { - }; - - void enable_color(void); --int check_enable_color(int color, int json); -+bool check_enable_color(int color, int json); - bool matches_color(const char *arg, int *val); - void set_color_palette(void); - int color_fprintf(FILE *fp, enum color_attr attr, const char *fmt, ...); -diff --git a/lib/color.c b/lib/color.c -index 9c9023587748f..eaf69e74d673a 100644 ---- a/lib/color.c -+++ b/lib/color.c -@@ -79,16 +79,16 @@ void enable_color(void) - set_color_palette(); - } - --int check_enable_color(int color, int json) -+bool check_enable_color(int color, int json) - { - if (json || color == COLOR_OPT_NEVER) -- return 1; -+ return false; - - if (color == COLOR_OPT_ALWAYS || isatty(fileno(stdout))) { - enable_color(); -- return 0; -+ return true; - } -- return 1; -+ return false; - } - - bool matches_color(const char *arg, int *val) --- -2.18.0 - diff --git a/0008-iprule-Fix-destination-prefix-output.patch b/0008-iprule-Fix-destination-prefix-output.patch deleted file mode 100644 index a5b8b83..0000000 --- a/0008-iprule-Fix-destination-prefix-output.patch +++ /dev/null @@ -1,40 +0,0 @@ -From b068329d161b5841e9e451fcf542987c3e487e70 Mon Sep 17 00:00:00 2001 -From: Stefan Bader -Date: Tue, 28 Aug 2018 16:27:29 +0200 -Subject: [PATCH] iprule: Fix destination prefix output - -When adding support for JSON output the new code for printing -the destination prefix adds a stray blank character before -the bitmask. This causes some user-space parsing to fail. - -Current output: - ...: from x.x.x.x/l to y.y.y.y /l -Previous output: - ...: from x.x.x.x/l to y.y.y.y/l - -Fixes: 0dd4ccc5 "iprule: add json support" -Signed-off-by: Stefan Bader -Acked-by: Luca Boccassi -Signed-off-by: Stephen Hemminger -(cherry picked from commit 1a75322c5a8dee6e1ed0017d76c87ef85c505b98) -Signed-off-by: Phil Sutter ---- - ip/iprule.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ip/iprule.c b/ip/iprule.c -index 8b9421431c26a..744d6d88e3433 100644 ---- a/ip/iprule.c -+++ b/ip/iprule.c -@@ -239,7 +239,7 @@ int print_rule(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) - - print_string(PRINT_FP, NULL, "to ", NULL); - print_color_string(PRINT_ANY, ifa_family_color(frh->family), -- "dst", "%s ", dst); -+ "dst", "%s", dst); - if (frh->dst_len != host_len) - print_uint(PRINT_ANY, "dstlen", "/%u ", frh->dst_len); - else --- -2.18.0 - diff --git a/0009-man-ip-route-Clarify-referenced-versions-are-Linux-o.patch b/0009-man-ip-route-Clarify-referenced-versions-are-Linux-o.patch deleted file mode 100644 index a2ff88f..0000000 --- a/0009-man-ip-route-Clarify-referenced-versions-are-Linux-o.patch +++ /dev/null @@ -1,132 +0,0 @@ -From 100905845b930a10174cc239895858a534c10906 Mon Sep 17 00:00:00 2001 -From: Phil Sutter -Date: Wed, 15 Aug 2018 11:18:26 +0200 -Subject: [PATCH] man: ip-route: Clarify referenced versions are Linux ones - -Versioning scheme of Linux and iproute2 is similar, therefore the -referenced kernel versions are likely to confuse readers. Clarify this -by prefixing each kernel version by 'Linux' prefix. - -Signed-off-by: Phil Sutter -Signed-off-by: Stephen Hemminger -(cherry picked from commit 8a03a2f36f767bd36b22929c78a370bd43059aee) -Signed-off-by: Phil Sutter ---- - man/man8/ip-route.8.in | 30 +++++++++++++++--------------- - 1 file changed, 15 insertions(+), 15 deletions(-) - -diff --git a/man/man8/ip-route.8.in b/man/man8/ip-route.8.in -index b21a847241427..a33ce1f0f4006 100644 ---- a/man/man8/ip-route.8.in -+++ b/man/man8/ip-route.8.in -@@ -483,43 +483,43 @@ seconds and ms, msec or msecs to specify milliseconds. - - - .TP --.BI rttvar " TIME " "(2.3.15+ only)" -+.BI rttvar " TIME " "(Linux 2.3.15+ only)" - the initial RTT variance estimate. Values are specified as with - .BI rtt - above. - - .TP --.BI rto_min " TIME " "(2.6.23+ only)" -+.BI rto_min " TIME " "(Linux 2.6.23+ only)" - the minimum TCP Retransmission TimeOut to use when communicating with this - destination. Values are specified as with - .BI rtt - above. - - .TP --.BI ssthresh " NUMBER " "(2.3.15+ only)" -+.BI ssthresh " NUMBER " "(Linux 2.3.15+ only)" - an estimate for the initial slow start threshold. - - .TP --.BI cwnd " NUMBER " "(2.3.15+ only)" -+.BI cwnd " NUMBER " "(Linux 2.3.15+ only)" - the clamp for congestion window. It is ignored if the - .B lock - flag is not used. - - .TP --.BI initcwnd " NUMBER " "(2.5.70+ only)" -+.BI initcwnd " NUMBER " "(Linux 2.5.70+ only)" - the initial congestion window size for connections to this destination. - Actual window size is this value multiplied by the MSS - (``Maximal Segment Size'') for same connection. The default is - zero, meaning to use the values specified in RFC2414. - - .TP --.BI initrwnd " NUMBER " "(2.6.33+ only)" -+.BI initrwnd " NUMBER " "(Linux 2.6.33+ only)" - the initial receive window size for connections to this destination. - Actual window size is this value multiplied by the MSS of the connection. - The default value is zero, meaning to use Slow Start value. - - .TP --.BI features " FEATURES " (3.18+ only) -+.BI features " FEATURES " (Linux 3.18+ only) - Enable or disable per-route features. Only available feature at this - time is - .B ecn -@@ -531,17 +531,17 @@ also be used even if the - sysctl is set to 0. - - .TP --.BI quickack " BOOL " "(3.11+ only)" -+.BI quickack " BOOL " "(Linux 3.11+ only)" - Enable or disable quick ack for connections to this destination. - - .TP --.BI fastopen_no_cookie " BOOL " "(4.15+ only)" -+.BI fastopen_no_cookie " BOOL " "(Linux 4.15+ only)" - Enable TCP Fastopen without a cookie for connections to this destination. - - .TP --.BI congctl " NAME " "(3.20+ only)" -+.BI congctl " NAME " "(Linux 3.20+ only)" - .TP --.BI "congctl lock" " NAME " "(3.20+ only)" -+.BI "congctl lock" " NAME " "(Linux 3.20+ only)" - Sets a specific TCP congestion control algorithm only for a given destination. - If not specified, Linux keeps the current global default TCP congestion control - algorithm, or the one set from the application. If the modifier -@@ -554,14 +554,14 @@ control algorithm for that destination, thus it will be enforced/guaranteed to - use the proposed algorithm. - - .TP --.BI advmss " NUMBER " "(2.3.15+ only)" -+.BI advmss " NUMBER " "(Linux 2.3.15+ only)" - the MSS ('Maximal Segment Size') to advertise to these - destinations when establishing TCP connections. If it is not given, - Linux uses a default value calculated from the first hop device MTU. - (If the path to these destination is asymmetric, this guess may be wrong.) - - .TP --.BI reordering " NUMBER " "(2.3.15+ only)" -+.BI reordering " NUMBER " "(Linux 2.3.15+ only)" - Maximal reordering on the path to this destination. - If it is not given, Linux uses the value selected with - .B sysctl -@@ -782,7 +782,7 @@ is a set of encapsulation attributes specific to the - .IR SEG6_ACTION " [ " - .IR SEG6_ACTION_PARAM " ] " - - Operation to perform on matching packets. --The following actions are currently supported (\fB4.14+ only\fR). -+The following actions are currently supported (\fBLinux 4.14+ only\fR). - .in +2 - - .B End -@@ -830,7 +830,7 @@ address is set as described in \fBip-sr\fR(8). - .in -8 - - .TP --.BI expires " TIME " "(4.4+ only)" -+.BI expires " TIME " "(Linux 4.4+ only)" - the route will be deleted after the expires time. - .B Only - support IPv6 at present. --- -2.18.0 - diff --git a/avpkt b/avpkt deleted file mode 100644 index c362b94..0000000 --- a/avpkt +++ /dev/null @@ -1 +0,0 @@ -AVPKT=3000 diff --git a/cbq-0000.example b/cbq-0000.example deleted file mode 100644 index 5503374..0000000 --- a/cbq-0000.example +++ /dev/null @@ -1,5 +0,0 @@ -DEVICE=eth0,10Mbit,1Mbit -RATE=128Kbit -WEIGHT=10Kbit -PRIO=5 -RULE=192.168.1.0/24 diff --git a/iproute.spec b/iproute.spec index d6ac84b..cc69f88 100644 --- a/iproute.spec +++ b/iproute.spec @@ -1,36 +1,22 @@ %global cbq_version v0.7.3 Summary: Advanced IP routing and network device configuration tools Name: iproute -Version: 4.20.04.20.0 -Release: 1%{?dist}1%{?dist} +Version: 4.20.0 +Release: 1%{?dist} 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 -# 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. -Patch1: 0001-Add-cbq.8-as-an-alias-to-tc-cbq.8.patch -# Fix for bz#1615373 -Patch2: 0002-ss-Review-ssfilter.patch -# Fix for bz#1582898 -Patch3: 0003-tc-Fix-typo-in-check-for-colored-output.patch -Patch4: 0004-bridge-Fix-check-for-colored-output.patch -Patch5: 0005-Merge-common-code-for-conditionally-colored-output.patch -Patch6: 0006-Make-colored-output-configurable.patch -Patch7: 0007-lib-Make-check_enable_color-return-boolean.patch -# Fix for bz#1623488 -Patch8: 0008-iprule-Fix-destination-prefix-output.patch -# Fix for bz#1391099 -Patch9: 0009-man-ip-route-Clarify-referenced-versions-are-Linux-o.patch +Patch0: 0001-configure-fix-typo-in-check_xt_old_internal_h.patch +Patch1: 0002-man-ss.8-more-line-breaks.patch +Patch2: 0003-man-tc-taprio.8-fix-syntax-error.patch License: GPLv2+ and Public Domain -BuildRequires: gcc +BuildRequires: gcc BuildRequires: bison BuildRequires: elfutils-libelf-devel BuildRequires: flex BuildRequires: iptables-devel >= 1.4.5 +BuildRequires: libcap-devel BuildRequires: libdb-devel BuildRequires: libmnl-devel BuildRequires: libselinux-devel @@ -84,10 +70,10 @@ The libnetlink static library. %autosetup -p1 -n %{name}2-%{version} %build -export CFLAGS="%{optflags}" -export LDFLAGS="%{build_ldflags}" -export LIBDIR=/%{_libdir} -export IPT_LIB_DIR=/%{_lib}/xtables +export CFLAGS='%{optflags}' +export LDFLAGS='%{build_ldflags}' +export LIBDIR='%{_libdir}' +export IPT_LIB_DIR='/%{_lib}/xtables' ./configure make %{?_smp_mflags} @@ -100,41 +86,22 @@ export CONFDIR='%{_sysconfdir}/iproute2' export DOCDIR='%{_docdir}' make install -install -m755 examples/cbq.init-%{cbq_version} ${DESTDIR}/${SBINDIR}/cbq - -install -d -m755 %{buildroot}%{_sysconfdir}/sysconfig/cbq -for config in \ - %{SOURCE1} \ - %{SOURCE2} - do install -m644 ${config} %{buildroot}%{_sysconfdir}/sysconfig/cbq -done - -# extra man pages from Patch1, seems like these are not mainline yet -for mp in cbq genl ifcfg ifstat; do - install -m644 man/man8/${mp}.8 %{buildroot}%{_mandir}/man8 -done - # libnetlink install -D -m644 include/libnetlink.h %{buildroot}%{_includedir}/libnetlink.h install -D -m644 lib/libnetlink.a %{buildroot}%{_libdir}/libnetlink.a -# drop these files, iproute-doc package extracts files directly from _builddir -rm -rf '%{buildroot}%{_docdir}' - %files %dir %{_sysconfdir}/iproute2 %{!?_licensedir:%global license %%doc} %license COPYING -%doc README README.decnet README.distribution README.lnstat +%doc README README.distribution README.lnstat %{_mandir}/man7/* %exclude %{_mandir}/man7/tc-* %{_mandir}/man8/* %exclude %{_mandir}/man8/tc* -%exclude %{_mandir}/man8/cbq* %attr(644,root,root) %config(noreplace) %{_sysconfdir}/iproute2/* %{_sbindir}/* %exclude %{_sbindir}/tc -%exclude %{_sbindir}/cbq %files tc %{!?_licensedir:%global license %%doc} @@ -142,20 +109,16 @@ rm -rf '%{buildroot}%{_docdir}' %doc README.iproute2+tc %{_mandir}/man7/tc-* %{_mandir}/man8/tc* -%{_mandir}/man8/cbq* %dir %{_libdir}/tc/ %{_libdir}/tc/* %{_sbindir}/tc -%{_sbindir}/cbq -%dir %{_sysconfdir}/sysconfig/cbq -%config(noreplace) %{_sysconfdir}/sysconfig/cbq/* %{_datadir}/bash-completion/completions/tc %if ! 0%{?_module_build} %files doc %{!?_licensedir:%global license %%doc} %license COPYING -%doc examples +%doc %{_docdir}/examples %endif %files devel @@ -167,8 +130,11 @@ rm -rf '%{buildroot}%{_docdir}' %{_includedir}/iproute2/bpf_elf.h %changelog -* Fri Feb 01 2019 Phil Sutter - 4.20.04.20.0-11 +* Fri Feb 01 2019 Phil Sutter - 4.20.0-1 - New version 4.20.0 +- Add upstream-suggested backports +- Upstream dropped cbq script, remove it along with related configs +- Add libcap support * Fri Feb 01 2019 Fedora Release Engineering - 4.18.0-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild