diff --git a/.gitignore b/.gitignore index fd6d31a..b21cca6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ -/iproute2-6.8.0.tar.xz -/iproute2-6.10.0.tar.xz -/iproute2-6.12.0.tar.xz -/iproute2-6.14.0.tar.xz -/iproute2-6.16.0.tar.xz -/iproute2-6.17.0.tar.xz +/iproute2-4.18.0.tar.xz +/iproute2-4.20.0.tar.xz +/iproute2-5.0.0.tar.xz +/iproute2-5.1.0.tar.xz +/iproute2-5.2.0.tar.xz +/iproute2-5.3.0.tar.xz +/iproute2-5.4.0.tar.xz diff --git a/0001-devlink-allow-full-range-of-resource-sizes.patch b/0001-devlink-allow-full-range-of-resource-sizes.patch new file mode 100644 index 0000000..6f0f252 --- /dev/null +++ b/0001-devlink-allow-full-range-of-resource-sizes.patch @@ -0,0 +1,43 @@ +From 6304309e2ab98c9125c58f3bcc7e86abcf904f35 Mon Sep 17 00:00:00 2001 +From: Jakub Kicinski +Date: Tue, 5 Nov 2019 13:17:07 -0800 +Subject: [PATCH] devlink: allow full range of resource sizes + +Resource size is a 64 bit attribute at netlink level. +Make the command line argument 64 bit as well. + +Fixes: 8cd644095842 ("devlink: Add support for devlink resource abstraction") +Signed-off-by: Jakub Kicinski +Acked-by: Jiri Pirko +Signed-off-by: David Ahern +(cherry picked from commit c3f69bf923dea50e48564fd520fec6314ddbcf5f) +Signed-off-by: Phil Sutter +--- + devlink/devlink.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/devlink/devlink.c b/devlink/devlink.c +index 056ac95ee726f..ebffa8c80ffef 100644 +--- a/devlink/devlink.c ++++ b/devlink/devlink.c +@@ -281,7 +281,7 @@ struct dl_opts { + bool dpipe_counters_enable; + bool eswitch_encap_mode; + const char *resource_path; +- uint32_t resource_size; ++ uint64_t resource_size; + uint32_t resource_id; + bool resource_id_valid; + const char *param_name; +@@ -1334,7 +1334,7 @@ static int dl_argv_parse(struct dl *dl, uint64_t o_required, + } else if (dl_argv_match(dl, "size") && + (o_all & DL_OPT_RESOURCE_SIZE)) { + dl_arg_inc(dl); +- err = dl_argv_uint32_t(dl, &opts->resource_size); ++ err = dl_argv_uint64_t(dl, &opts->resource_size); + if (err) + return err; + o_found |= DL_OPT_RESOURCE_SIZE; +-- +2.27.0 + diff --git a/0002-tc-fix-warning-in-tc-m_ct.c.patch b/0002-tc-fix-warning-in-tc-m_ct.c.patch new file mode 100644 index 0000000..7e6fdfb --- /dev/null +++ b/0002-tc-fix-warning-in-tc-m_ct.c.patch @@ -0,0 +1,35 @@ +From fc3fd84e56052c7f29a052f4f903a86feab50fe5 Mon Sep 17 00:00:00 2001 +From: Brian Vazquez +Date: Tue, 26 Nov 2019 21:19:34 -0800 +Subject: [PATCH] tc: fix warning in tc/m_ct.c + +Warning was: +m_ct.c:370:13: warning: variable 'nat' is used uninitialized whenever +'if' condition is false + +Cc: Paul Blakey +Fixes: c8a494314c40 ("tc: Introduce tc ct action") +Signed-off-by: Brian Vazquez +Signed-off-by: Stephen Hemminger +(cherry picked from commit cad1b0bc5f12be7c3b5a1a4c1b55646a0766c9a8) +Signed-off-by: Phil Sutter +--- + tc/m_ct.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tc/m_ct.c b/tc/m_ct.c +index 8df2f61036014..45fa4a8c9ff49 100644 +--- a/tc/m_ct.c ++++ b/tc/m_ct.c +@@ -359,7 +359,7 @@ static void ct_print_nat(int ct_action, struct rtattr **tb) + { + size_t done = 0; + char out[256] = ""; +- bool nat; ++ bool nat = false; + + if (!(ct_action & TCA_CT_ACT_NAT)) + return; +-- +2.27.0 + diff --git a/0003-tc-fix-warning-in-tc-q_pie.c.patch b/0003-tc-fix-warning-in-tc-q_pie.c.patch new file mode 100644 index 0000000..49c8aa3 --- /dev/null +++ b/0003-tc-fix-warning-in-tc-q_pie.c.patch @@ -0,0 +1,40 @@ +From 4f058d48daf52e9a0bad4a7b2bf8e2a78ecd37a3 Mon Sep 17 00:00:00 2001 +From: Brian Vazquez +Date: Wed, 4 Dec 2019 13:32:03 -0800 +Subject: [PATCH] tc: fix warning in tc/q_pie.c + +Warning was: +q_pie.c:202:22: error: implicit conversion from 'unsigned long' to +'double' + +Fixes: 492ec9558b30 ("tc: pie: change maximum integer value of tc_pie_xstats->prob") +Cc: Leslie Monis +Signed-off-by: Brian Vazquez +Signed-off-by: Stephen Hemminger +(cherry picked from commit 908985c6709b6c0673501d61748c080889382d4f) + +Conflicts: +* tc/q_pie.c - Change applied manually, conflicts due to missing commit + 920700a425e51 ("tc: pie: add dq_rate_estimator option"). + +Signed-off-by: Phil Sutter +--- + tc/q_pie.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tc/q_pie.c b/tc/q_pie.c +index 40982f9618783..52ba725614e30 100644 +--- a/tc/q_pie.c ++++ b/tc/q_pie.c +@@ -199,7 +199,7 @@ static int pie_print_xstats(struct qdisc_util *qu, FILE *f, + st = RTA_DATA(xstats); + /*prob is returned as a fracion of maximum integer value */ + fprintf(f, "prob %f delay %uus avg_dq_rate %u\n", +- (double)st->prob / UINT64_MAX, st->delay, ++ (double)st->prob / (double)UINT64_MAX, st->delay, + st->avg_dq_rate); + fprintf(f, "pkts_in %u overlimit %u dropped %u maxq %u ecn_mark %u\n", + st->packets_in, st->overlimit, st->dropped, st->maxq, +-- +2.27.0 + diff --git a/0004-json_print-Remove-declaration-without-implementation.patch b/0004-json_print-Remove-declaration-without-implementation.patch new file mode 100644 index 0000000..33d8760 --- /dev/null +++ b/0004-json_print-Remove-declaration-without-implementation.patch @@ -0,0 +1,30 @@ +From 936a32a7b52175f8fed43651d15cb9b4740e821d Mon Sep 17 00:00:00 2001 +From: Benjamin Poirier +Date: Mon, 16 Dec 2019 15:43:37 +0900 +Subject: [PATCH] json_print: Remove declaration without implementation + +Fixes: 6377572f0aa8 ("ip: ip_print: add new API to print JSON or regular format output") +Signed-off-by: Benjamin Poirier +Signed-off-by: Stephen Hemminger +(cherry picked from commit 15322f46c3427a7d065b41fc5b0e513755329295) +Signed-off-by: Phil Sutter +--- + include/json_print.h | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/include/json_print.h b/include/json_print.h +index fe92d14ca451f..6695654f71947 100644 +--- a/include/json_print.h ++++ b/include/json_print.h +@@ -34,8 +34,6 @@ void delete_json_obj(void); + + bool is_json_context(void); + +-void fflush_fp(void); +- + void open_json_object(const char *str); + void close_json_object(void); + void open_json_array(enum output_type type, const char *delim); +-- +2.27.0 + diff --git a/0005-testsuite-Fix-line-count-test.patch b/0005-testsuite-Fix-line-count-test.patch new file mode 100644 index 0000000..a473864 --- /dev/null +++ b/0005-testsuite-Fix-line-count-test.patch @@ -0,0 +1,32 @@ +From dda39d1122c5538247190287b3cc0a42196f9215 Mon Sep 17 00:00:00 2001 +From: Benjamin Poirier +Date: Mon, 16 Dec 2019 15:43:38 +0900 +Subject: [PATCH] testsuite: Fix line count test + +a substring match is not enough, ex: 10 != 1 + +Fixes: 30383b074de1 ("tests: Add output testing") +Signed-off-by: Benjamin Poirier +Signed-off-by: Stephen Hemminger +(cherry picked from commit d88a6a98e86da9446487ecc4f1fea435323ef21d) +Signed-off-by: Phil Sutter +--- + testsuite/lib/generic.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/testsuite/lib/generic.sh b/testsuite/lib/generic.sh +index f92260fc40cf3..e909008aa49cb 100644 +--- a/testsuite/lib/generic.sh ++++ b/testsuite/lib/generic.sh +@@ -121,7 +121,7 @@ test_on_not() + test_lines_count() + { + echo -n "test on lines count ($1): " +- if cat "$STD_OUT" | wc -l | grep -q "$1" ++ if [ $(cat "$STD_OUT" | wc -l) -eq "$1" ] + then + pr_success + else +-- +2.27.0 + diff --git a/0006-bridge-Fix-typo-in-error-messages.patch b/0006-bridge-Fix-typo-in-error-messages.patch new file mode 100644 index 0000000..01b8b9e --- /dev/null +++ b/0006-bridge-Fix-typo-in-error-messages.patch @@ -0,0 +1,49 @@ +From 07772a2b3ab7d3ca8cd9994bfd2d45d4ddedf33f Mon Sep 17 00:00:00 2001 +From: Benjamin Poirier +Date: Mon, 16 Dec 2019 15:43:39 +0900 +Subject: [PATCH] bridge: Fix typo in error messages + +Fixes: 9eff0e5cc447 ("bridge: Add vlan configuration support") +Fixes: 7abf5de677e3 ("bridge: vlan: add support to display per-vlan statistics") +Signed-off-by: Benjamin Poirier +Signed-off-by: Stephen Hemminger +(cherry picked from commit 43b0b6ec840c27bd9b8d014f338d0235cb2618a0) +Signed-off-by: Phil Sutter +--- + bridge/vlan.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/bridge/vlan.c b/bridge/vlan.c +index 6d33b0a990a5e..6dc694b6565b7 100644 +--- a/bridge/vlan.c ++++ b/bridge/vlan.c +@@ -576,7 +576,7 @@ static int vlan_show(int argc, char **argv) + (compress_vlans ? + RTEXT_FILTER_BRVLAN_COMPRESSED : + RTEXT_FILTER_BRVLAN)) < 0) { +- perror("Cannont send dump request"); ++ perror("Cannot send dump request"); + exit(1); + } + +@@ -601,7 +601,7 @@ static int vlan_show(int argc, char **argv) + + filt_mask = IFLA_STATS_FILTER_BIT(IFLA_STATS_LINK_XSTATS); + if (rtnl_statsdump_req_filter(&rth, AF_UNSPEC, filt_mask) < 0) { +- perror("Cannont send dump request"); ++ perror("Cannot send dump request"); + exit(1); + } + +@@ -615,7 +615,7 @@ static int vlan_show(int argc, char **argv) + + filt_mask = IFLA_STATS_FILTER_BIT(IFLA_STATS_LINK_XSTATS_SLAVE); + if (rtnl_statsdump_req_filter(&rth, AF_UNSPEC, filt_mask) < 0) { +- perror("Cannont send slave dump request"); ++ perror("Cannot send slave dump request"); + exit(1); + } + +-- +2.27.0 + diff --git a/0007-bridge-Fix-src_vni-argument-in-man-page.patch b/0007-bridge-Fix-src_vni-argument-in-man-page.patch new file mode 100644 index 0000000..b237731 --- /dev/null +++ b/0007-bridge-Fix-src_vni-argument-in-man-page.patch @@ -0,0 +1,44 @@ +From 038122146f45759893040d7ae648c99ac0058060 Mon Sep 17 00:00:00 2001 +From: Benjamin Poirier +Date: Mon, 16 Dec 2019 15:43:40 +0900 +Subject: [PATCH] bridge: Fix src_vni argument in man page + +"SRC VNI" is only one argument and should appear as such. Moreover, this +argument to the src_vni option is documented under three forms: "SRC_VNI", +"SRC VNI" and "VNI" in different places. Consistenly use the simplest form, +"VNI". + +Fixes: c5b176e5ba1f ("bridge: fdb: add support for src_vni option") +Signed-off-by: Benjamin Poirier +Signed-off-by: Stephen Hemminger +(cherry picked from commit df1262155c4b3102e6d01ec082ad123377248019) +Signed-off-by: Phil Sutter +--- + man/man8/bridge.8 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/man/man8/bridge.8 b/man/man8/bridge.8 +index bb4fb521f8e57..fafdee75e2b36 100644 +--- a/man/man8/bridge.8 ++++ b/man/man8/bridge.8 +@@ -71,7 +71,7 @@ bridge \- show / manipulate bridge addresses and devices + .B dst + .IR IPADDR " ] [ " + .B src_vni +-.IR SRC_VNI " ] [" ++.IR VNI " ] [" + .B vni + .IR VNI " ] [" + .B port +@@ -487,7 +487,7 @@ the IP address of the destination + VXLAN tunnel endpoint where the Ethernet MAC ADDRESS resides. + + .TP +-.BI src_vni " SRC VNI" ++.BI src_vni " VNI" + the src VNI Network Identifier (or VXLAN Segment ID) + this entry belongs to. Used only when the vxlan device is in + external or collect metadata mode. If omitted the value specified at +-- +2.27.0 + diff --git a/0008-bridge-Fix-BRIDGE_VLAN_TUNNEL-attribute-sizes.patch b/0008-bridge-Fix-BRIDGE_VLAN_TUNNEL-attribute-sizes.patch new file mode 100644 index 0000000..350b901 --- /dev/null +++ b/0008-bridge-Fix-BRIDGE_VLAN_TUNNEL-attribute-sizes.patch @@ -0,0 +1,53 @@ +From 7787d5f4124cf617eb0726ddf6f0b65af3153c11 Mon Sep 17 00:00:00 2001 +From: Benjamin Poirier +Date: Mon, 16 Dec 2019 15:43:41 +0900 +Subject: [PATCH] bridge: Fix BRIDGE_VLAN_TUNNEL attribute sizes + +As per the kernel's vlan_tunnel_policy, IFLA_BRIDGE_VLAN_TUNNEL_VID and +IFLA_BRIDGE_VLAN_TUNNEL_FLAGS have type NLA_U16. + +Fixes: 8652eeb3ab12 ("bridge: vlan: support for per vlan tunnel info") +Signed-off-by: Benjamin Poirier +Signed-off-by: Stephen Hemminger +(cherry picked from commit 1f53ba7297a8b8189fd6853c480de2f6bf9ac787) +Signed-off-by: Phil Sutter +--- + bridge/vlan.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/bridge/vlan.c b/bridge/vlan.c +index 6dc694b6565b7..c0294aa6990cb 100644 +--- a/bridge/vlan.c ++++ b/bridge/vlan.c +@@ -71,8 +71,8 @@ static int add_tunnel_info(struct nlmsghdr *n, int reqsize, + + tinfo = addattr_nest(n, reqsize, IFLA_BRIDGE_VLAN_TUNNEL_INFO); + addattr32(n, reqsize, IFLA_BRIDGE_VLAN_TUNNEL_ID, tun_id); +- addattr32(n, reqsize, IFLA_BRIDGE_VLAN_TUNNEL_VID, vid); +- addattr32(n, reqsize, IFLA_BRIDGE_VLAN_TUNNEL_FLAGS, flags); ++ addattr16(n, reqsize, IFLA_BRIDGE_VLAN_TUNNEL_VID, vid); ++ addattr16(n, reqsize, IFLA_BRIDGE_VLAN_TUNNEL_FLAGS, flags); + + addattr_nest_end(n, tinfo); + +@@ -304,7 +304,7 @@ static void print_vlan_tunnel_info(FILE *fp, struct rtattr *tb, int ifindex) + + if (ttb[IFLA_BRIDGE_VLAN_TUNNEL_VID]) + tunnel_vid = +- rta_getattr_u32(ttb[IFLA_BRIDGE_VLAN_TUNNEL_VID]); ++ rta_getattr_u16(ttb[IFLA_BRIDGE_VLAN_TUNNEL_VID]); + else + continue; + +@@ -314,7 +314,7 @@ static void print_vlan_tunnel_info(FILE *fp, struct rtattr *tb, int ifindex) + + if (ttb[IFLA_BRIDGE_VLAN_TUNNEL_FLAGS]) + tunnel_flags = +- rta_getattr_u32(ttb[IFLA_BRIDGE_VLAN_TUNNEL_FLAGS]); ++ rta_getattr_u16(ttb[IFLA_BRIDGE_VLAN_TUNNEL_FLAGS]); + + if (!(tunnel_flags & BRIDGE_VLAN_INFO_RANGE_END)) { + last_vid_start = tunnel_vid; +-- +2.27.0 + diff --git a/0009-bridge-Fix-vni-printing.patch b/0009-bridge-Fix-vni-printing.patch new file mode 100644 index 0000000..bd02316 --- /dev/null +++ b/0009-bridge-Fix-vni-printing.patch @@ -0,0 +1,114 @@ +From 198678f2115f2c0f50bea3754116779f5adf6a0b Mon Sep 17 00:00:00 2001 +From: Benjamin Poirier +Date: Mon, 16 Dec 2019 15:43:42 +0900 +Subject: [PATCH] bridge: Fix vni printing + +Since commit c7c1a1ef51ae ("bridge: colorize output and use JSON print +library"), print_range() is used for vid (16bits) and vni. However, the +latter are 32bits so they get truncated. They got truncated even before +that commit though. + +Fixes: 8652eeb3ab12 ("bridge: vlan: support for per vlan tunnel info") +Signed-off-by: Benjamin Poirier +Signed-off-by: Stephen Hemminger +(cherry picked from commit dfa13e2273b206419ec0199a11c92122f2e8ea33) +Signed-off-by: Phil Sutter +--- + bridge/vlan.c | 6 +++--- + testsuite/Makefile | 3 ++- + testsuite/lib/generic.sh | 6 +++++- + testsuite/tests/bridge/vlan/tunnelshow.t | 24 ++++++++++++++++++++++++ + 4 files changed, 34 insertions(+), 5 deletions(-) + create mode 100755 testsuite/tests/bridge/vlan/tunnelshow.t + +diff --git a/bridge/vlan.c b/bridge/vlan.c +index c0294aa6990cb..428eeee3c5aef 100644 +--- a/bridge/vlan.c ++++ b/bridge/vlan.c +@@ -266,15 +266,15 @@ static void close_vlan_port(void) + close_json_object(); + } + +-static void print_range(const char *name, __u16 start, __u16 id) ++static void print_range(const char *name, __u32 start, __u32 id) + { + char end[64]; + + snprintf(end, sizeof(end), "%sEnd", name); + +- print_hu(PRINT_ANY, name, "\t %hu", start); ++ print_uint(PRINT_ANY, name, "\t %u", start); + if (start != id) +- print_hu(PRINT_ANY, end, "-%hu", id); ++ print_uint(PRINT_ANY, end, "-%u", id); + + } + +diff --git a/testsuite/Makefile b/testsuite/Makefile +index 4451f316910df..fb50f618a3beb 100644 +--- a/testsuite/Makefile ++++ b/testsuite/Makefile +@@ -82,7 +82,8 @@ endif + TMP_OUT=`mktemp /tmp/tc_testsuite.XXXXXX`; \ + . $(KENVFN); \ + STD_ERR="$$TMP_ERR" STD_OUT="$$TMP_OUT" \ +- TC="$$i/tc/tc" IP="$$i/ip/ip" SS=$$i/misc/ss DEV="$(DEV)" IPVER="$@" SNAME="$$i" \ ++ TC="$$i/tc/tc" IP="$$i/ip/ip" SS=$$i/misc/ss BRIDGE="$$i/bridge/bridge" \ ++ DEV="$(DEV)" IPVER="$@" SNAME="$$i" \ + ERRF="$(RESULTS_DIR)/$@.$$o.err" $(PREFIX) tests/$@ > $(RESULTS_DIR)/$@.$$o.out; \ + if [ "$$?" = "127" ]; then \ + printf "\033[1;35mSKIPPED\033[0m\n"; \ +diff --git a/testsuite/lib/generic.sh b/testsuite/lib/generic.sh +index e909008aa49cb..8b339ec175037 100644 +--- a/testsuite/lib/generic.sh ++++ b/testsuite/lib/generic.sh +@@ -1,4 +1,3 @@ +- + export DEST="127.0.0.1" + + ts_log() +@@ -66,6 +65,11 @@ ts_ss() + __ts_cmd "$SS" "$@" + } + ++ts_bridge() ++{ ++ __ts_cmd "$BRIDGE" "$@" ++} ++ + ts_qdisc_available() + { + HELPOUT=`$TC qdisc add $1 help 2>&1` +diff --git a/testsuite/tests/bridge/vlan/tunnelshow.t b/testsuite/tests/bridge/vlan/tunnelshow.t +new file mode 100755 +index 0000000000000..1583abb92f472 +--- /dev/null ++++ b/testsuite/tests/bridge/vlan/tunnelshow.t +@@ -0,0 +1,24 @@ ++#!/bin/sh ++ ++. lib/generic.sh ++ ++ts_log "[Testing tunnelshow]" ++ ++BR_DEV="$(rand_dev)" ++VX_DEV="$(rand_dev)" ++ ++ts_ip "$0" "Add $BR_DEV bridge interface" link add $BR_DEV type bridge ++ ++ts_ip "$0" "Add $VX_DEV vxlan interface" \ ++ link add $VX_DEV type vxlan dstport 4789 external ++ts_ip "$0" "Enslave $VX_DEV under $BR_DEV" \ ++ link set dev $VX_DEV master $BR_DEV ++ts_ip "$0" "Set vlan_tunnel on $VX_DEV" \ ++ link set dev $VX_DEV type bridge_slave vlan_tunnel on ++ ++ts_bridge "$0" "Add single vlan" vlan add dev $VX_DEV vid 1030 ++ts_bridge "$0" "Add tunnel with vni > 16k" \ ++ vlan add dev $VX_DEV vid 1030 tunnel_info id 65556 ++ ++ts_bridge "$0" "Show tunnel info" vlan tunnelshow dev $VX_DEV ++test_on "1030\s+65556" +-- +2.27.0 + diff --git a/0010-bridge-Deduplicate-vlan-show-functions.patch b/0010-bridge-Deduplicate-vlan-show-functions.patch new file mode 100644 index 0000000..3ebe69a --- /dev/null +++ b/0010-bridge-Deduplicate-vlan-show-functions.patch @@ -0,0 +1,203 @@ +From 20fc76587210e8d03fe753bb039ac2c874fd0a4c Mon Sep 17 00:00:00 2001 +From: Benjamin Poirier +Date: Mon, 16 Dec 2019 15:43:43 +0900 +Subject: [PATCH] bridge: Deduplicate vlan show functions + +print_vlan() and print_vlan_tunnel() are almost identical copies, save for +a missing newline in the latter which leads to broken output of "vlan +tunnelshow" in normal mode. + +Fixes: c7c1a1ef51ae ("bridge: colorize output and use JSON print library") +Signed-off-by: Benjamin Poirier +Signed-off-by: Stephen Hemminger +(cherry picked from commit 955a20be027d2ff47b0c6fab3353c85cee614b90) +Signed-off-by: Phil Sutter +--- + bridge/vlan.c | 91 +++++++----------------- + testsuite/tests/bridge/vlan/tunnelshow.t | 7 ++ + 2 files changed, 34 insertions(+), 64 deletions(-) + +diff --git a/bridge/vlan.c b/bridge/vlan.c +index 428eeee3c5aef..19283bca7c986 100644 +--- a/bridge/vlan.c ++++ b/bridge/vlan.c +@@ -16,7 +16,11 @@ + #include "utils.h" + + static unsigned int filter_index, filter_vlan; +-static int show_vlan_tunnel_info = 0; ++ ++enum vlan_show_subject { ++ VLAN_SHOW_VLAN, ++ VLAN_SHOW_TUNNELINFO, ++}; + + static void usage(void) + { +@@ -278,7 +282,7 @@ static void print_range(const char *name, __u32 start, __u32 id) + + } + +-static void print_vlan_tunnel_info(FILE *fp, struct rtattr *tb, int ifindex) ++static void print_vlan_tunnel_info(struct rtattr *tb, int ifindex) + { + struct rtattr *i, *list = tb; + int rem = RTA_PAYLOAD(list); +@@ -347,52 +351,9 @@ static void print_vlan_tunnel_info(FILE *fp, struct rtattr *tb, int ifindex) + close_vlan_port(); + } + +-static int print_vlan_tunnel(struct nlmsghdr *n, void *arg) +-{ +- struct ifinfomsg *ifm = NLMSG_DATA(n); +- struct rtattr *tb[IFLA_MAX+1]; +- int len = n->nlmsg_len; +- FILE *fp = arg; +- +- if (n->nlmsg_type != RTM_NEWLINK) { +- fprintf(stderr, "Not RTM_NEWLINK: %08x %08x %08x\n", +- n->nlmsg_len, n->nlmsg_type, n->nlmsg_flags); +- return 0; +- } +- +- len -= NLMSG_LENGTH(sizeof(*ifm)); +- if (len < 0) { +- fprintf(stderr, "BUG: wrong nlmsg len %d\n", len); +- return -1; +- } +- +- if (ifm->ifi_family != AF_BRIDGE) +- return 0; +- +- if (filter_index && filter_index != ifm->ifi_index) +- return 0; +- +- parse_rtattr(tb, IFLA_MAX, IFLA_RTA(ifm), len); +- +- /* if AF_SPEC isn't there, vlan table is not preset for this port */ +- if (!tb[IFLA_AF_SPEC]) { +- if (!filter_vlan && !is_json_context()) { +- color_fprintf(fp, COLOR_IFNAME, "%s", +- ll_index_to_name(ifm->ifi_index)); +- fprintf(fp, "\tNone\n"); +- } +- return 0; +- } +- +- print_vlan_tunnel_info(fp, tb[IFLA_AF_SPEC], ifm->ifi_index); +- +- fflush(fp); +- return 0; +-} +- + static int print_vlan(struct nlmsghdr *n, void *arg) + { +- FILE *fp = arg; ++ enum vlan_show_subject *subject = arg; + struct ifinfomsg *ifm = NLMSG_DATA(n); + int len = n->nlmsg_len; + struct rtattr *tb[IFLA_MAX+1]; +@@ -420,17 +381,24 @@ static int print_vlan(struct nlmsghdr *n, void *arg) + /* if AF_SPEC isn't there, vlan table is not preset for this port */ + if (!tb[IFLA_AF_SPEC]) { + if (!filter_vlan && !is_json_context()) { +- color_fprintf(fp, COLOR_IFNAME, "%s", ++ color_fprintf(stdout, COLOR_IFNAME, "%s", + ll_index_to_name(ifm->ifi_index)); +- fprintf(fp, "\tNone\n"); ++ fprintf(stdout, "\tNone\n"); + } + return 0; + } + +- print_vlan_info(tb[IFLA_AF_SPEC], ifm->ifi_index); ++ switch (*subject) { ++ case VLAN_SHOW_VLAN: ++ print_vlan_info(tb[IFLA_AF_SPEC], ifm->ifi_index); ++ break; ++ case VLAN_SHOW_TUNNELINFO: ++ print_vlan_tunnel_info(tb[IFLA_AF_SPEC], ifm->ifi_index); ++ break; ++ } + print_string(PRINT_FP, NULL, "%s", _SL_); + +- fflush(fp); ++ fflush(stdout); + return 0; + } + +@@ -543,7 +511,7 @@ static int print_vlan_stats(struct nlmsghdr *n, void *arg) + return 0; + } + +-static int vlan_show(int argc, char **argv) ++static int vlan_show(int argc, char **argv, int subject) + { + char *filter_dev = NULL; + int ret = 0; +@@ -581,17 +549,13 @@ static int vlan_show(int argc, char **argv) + } + + if (!is_json_context()) { +- if (show_vlan_tunnel_info) +- printf("port\tvlan ids\ttunnel id\n"); +- else +- printf("port\tvlan ids\n"); ++ printf("port\tvlan ids"); ++ if (subject == VLAN_SHOW_TUNNELINFO) ++ printf("\ttunnel id"); ++ printf("\n"); + } + +- if (show_vlan_tunnel_info) +- ret = rtnl_dump_filter(&rth, print_vlan_tunnel, +- stdout); +- else +- ret = rtnl_dump_filter(&rth, print_vlan, stdout); ++ ret = rtnl_dump_filter(&rth, print_vlan, &subject); + if (ret < 0) { + fprintf(stderr, "Dump ternminated\n"); + exit(1); +@@ -677,15 +641,14 @@ int do_vlan(int argc, char **argv) + if (matches(*argv, "show") == 0 || + matches(*argv, "lst") == 0 || + matches(*argv, "list") == 0) +- return vlan_show(argc-1, argv+1); ++ return vlan_show(argc-1, argv+1, VLAN_SHOW_VLAN); + if (matches(*argv, "tunnelshow") == 0) { +- show_vlan_tunnel_info = 1; +- return vlan_show(argc-1, argv+1); ++ return vlan_show(argc-1, argv+1, VLAN_SHOW_TUNNELINFO); + } + if (matches(*argv, "help") == 0) + usage(); + } else { +- return vlan_show(0, NULL); ++ return vlan_show(0, NULL, VLAN_SHOW_VLAN); + } + + fprintf(stderr, "Command \"%s\" is unknown, try \"bridge vlan help\".\n", *argv); +diff --git a/testsuite/tests/bridge/vlan/tunnelshow.t b/testsuite/tests/bridge/vlan/tunnelshow.t +index 1583abb92f472..b2141e7c5ea4c 100755 +--- a/testsuite/tests/bridge/vlan/tunnelshow.t ++++ b/testsuite/tests/bridge/vlan/tunnelshow.t +@@ -16,9 +16,16 @@ ts_ip "$0" "Enslave $VX_DEV under $BR_DEV" \ + ts_ip "$0" "Set vlan_tunnel on $VX_DEV" \ + link set dev $VX_DEV type bridge_slave vlan_tunnel on + ++ts_bridge "$0" "Add single vlan" vlan add dev $VX_DEV vid 1000 ++ts_bridge "$0" "Add single tunnel" \ ++ vlan add dev $VX_DEV vid 1000 tunnel_info id 1000 ++ts_bridge "$0" "Add vlan range" vlan add dev $VX_DEV vid 1010-1020 ++ts_bridge "$0" "Add tunnel range" \ ++ vlan add dev $VX_DEV vid 1010-1020 tunnel_info id 1010-1020 + ts_bridge "$0" "Add single vlan" vlan add dev $VX_DEV vid 1030 + ts_bridge "$0" "Add tunnel with vni > 16k" \ + vlan add dev $VX_DEV vid 1030 tunnel_info id 65556 + + ts_bridge "$0" "Show tunnel info" vlan tunnelshow dev $VX_DEV + test_on "1030\s+65556" ++test_lines_count 5 +-- +2.27.0 + diff --git a/0011-bridge-Fix-tunnelshow-json-output.patch b/0011-bridge-Fix-tunnelshow-json-output.patch new file mode 100644 index 0000000..69cbf66 --- /dev/null +++ b/0011-bridge-Fix-tunnelshow-json-output.patch @@ -0,0 +1,115 @@ +From 1eaf42ad3be39090c6735f4de37669f38d8ed8eb Mon Sep 17 00:00:00 2001 +From: Benjamin Poirier +Date: Mon, 16 Dec 2019 15:43:44 +0900 +Subject: [PATCH] bridge: Fix tunnelshow json output + +repeats for "vlan tunnelshow" what commit 0f36267485e3 ("bridge: fix vlan +show formatting") did for "vlan show". This fixes problems in json output. + +Note that the resulting json output format of "vlan tunnelshow" is not the +same as the original, introduced in commit 8652eeb3ab12 ("bridge: vlan: +support for per vlan tunnel info"). Changes similar to the ones done for +"vlan show" in commit 0f36267485e3 ("bridge: fix vlan show formatting") are +carried over to "vlan tunnelshow". + +Fixes: c7c1a1ef51ae ("bridge: colorize output and use JSON print library") +Fixes: 0f36267485e3 ("bridge: fix vlan show formatting") +Signed-off-by: Benjamin Poirier +Signed-off-by: Stephen Hemminger +(cherry picked from commit 1a500c78aef0d4fd33c1700dbfcf435ea2c53847) +Signed-off-by: Phil Sutter +--- + bridge/vlan.c | 27 +++++++----------------- + testsuite/tests/bridge/vlan/tunnelshow.t | 2 ++ + 2 files changed, 10 insertions(+), 19 deletions(-) + +diff --git a/bridge/vlan.c b/bridge/vlan.c +index 19283bca7c986..205851e4f78ec 100644 +--- a/bridge/vlan.c ++++ b/bridge/vlan.c +@@ -256,12 +256,14 @@ static int filter_vlan_check(__u16 vid, __u16 flags) + return 1; + } + +-static void open_vlan_port(int ifi_index, const char *fmt) ++static void open_vlan_port(int ifi_index, const char *fmt, ++ enum vlan_show_subject subject) + { + open_json_object(NULL); + print_color_string(PRINT_ANY, COLOR_IFNAME, "ifname", fmt, + ll_index_to_name(ifi_index)); +- open_json_array(PRINT_JSON, "vlans"); ++ open_json_array(PRINT_JSON, ++ subject == VLAN_SHOW_VLAN ? "vlans": "tunnels"); + } + + static void close_vlan_port(void) +@@ -289,10 +291,8 @@ static void print_vlan_tunnel_info(struct rtattr *tb, int ifindex) + __u16 last_vid_start = 0; + __u32 last_tunid_start = 0; + +- if (!filter_vlan) +- open_vlan_port(ifindex, "%s"); ++ open_vlan_port(ifindex, "%s", VLAN_SHOW_TUNNELINFO); + +- open_json_array(PRINT_JSON, "tunnel"); + for (i = RTA_DATA(list); RTA_OK(i, rem); i = RTA_NEXT(i, rem)) { + struct rtattr *ttb[IFLA_BRIDGE_VLAN_TUNNEL_MAX+1]; + __u32 tunnel_id = 0; +@@ -331,24 +331,13 @@ static void print_vlan_tunnel_info(struct rtattr *tb, int ifindex) + else if (vcheck_ret == 0) + continue; + +- if (tunnel_flags & BRIDGE_VLAN_INFO_RANGE_BEGIN) +- continue; +- +- if (filter_vlan) +- open_vlan_port(ifindex, "%s"); +- + open_json_object(NULL); + print_range("vlan", last_vid_start, tunnel_vid); + print_range("tunid", last_tunid_start, tunnel_id); + close_json_object(); +- + print_string(PRINT_FP, NULL, "%s", _SL_); +- if (filter_vlan) +- close_vlan_port(); + } +- +- if (!filter_vlan) +- close_vlan_port(); ++ close_vlan_port(); + } + + static int print_vlan(struct nlmsghdr *n, void *arg) +@@ -467,7 +456,7 @@ static void print_vlan_stats_attr(struct rtattr *attr, int ifindex) + + /* found vlan stats, first time print the interface name */ + if (!found_vlan) { +- open_vlan_port(ifindex, "%-16s"); ++ open_vlan_port(ifindex, "%-16s", VLAN_SHOW_VLAN); + found_vlan = true; + } else { + print_string(PRINT_FP, NULL, "%-16s", ""); +@@ -600,7 +589,7 @@ void print_vlan_info(struct rtattr *tb, int ifindex) + int rem = RTA_PAYLOAD(list); + __u16 last_vid_start = 0; + +- open_vlan_port(ifindex, "%s"); ++ open_vlan_port(ifindex, "%s", VLAN_SHOW_VLAN); + + for (i = RTA_DATA(list); RTA_OK(i, rem); i = RTA_NEXT(i, rem)) { + struct bridge_vlan_info *vinfo; +diff --git a/testsuite/tests/bridge/vlan/tunnelshow.t b/testsuite/tests/bridge/vlan/tunnelshow.t +index b2141e7c5ea4c..fd41bfcb32a2b 100755 +--- a/testsuite/tests/bridge/vlan/tunnelshow.t ++++ b/testsuite/tests/bridge/vlan/tunnelshow.t +@@ -29,3 +29,5 @@ ts_bridge "$0" "Add tunnel with vni > 16k" \ + ts_bridge "$0" "Show tunnel info" vlan tunnelshow dev $VX_DEV + test_on "1030\s+65556" + test_lines_count 5 ++ ++ts_bridge "$0" "Dump tunnel info" -j vlan tunnelshow dev $VX_DEV +-- +2.27.0 + diff --git a/0012-devlink-Print-health-reporter-s-dump-time-stamp-in-a.patch b/0012-devlink-Print-health-reporter-s-dump-time-stamp-in-a.patch new file mode 100644 index 0000000..881775d --- /dev/null +++ b/0012-devlink-Print-health-reporter-s-dump-time-stamp-in-a.patch @@ -0,0 +1,81 @@ +From e3da5872ed0cb8180eff30a133e586868411fde3 Mon Sep 17 00:00:00 2001 +From: Aya Levin +Date: Wed, 11 Dec 2019 17:45:34 +0200 +Subject: [PATCH] devlink: Print health reporter's dump time-stamp in a helper + function + +Add pr_out_dump_reporter prefix to the helper function's name and +encapsulate the print in it. + +Fixes: 2f1242efe9d0 ("devlink: Add devlink health show command") +Signed-off-by: Aya Levin +Acked-by: Jiri Pirko +Signed-off-by: Tariq Toukan +Signed-off-by: Stephen Hemminger +(cherry picked from commit f678a2d08e9793fbd5996d206061b94aa3b8d88a) +Signed-off-by: Phil Sutter +--- + devlink/devlink.c | 26 ++++++++++---------------- + 1 file changed, 10 insertions(+), 16 deletions(-) + +diff --git a/devlink/devlink.c b/devlink/devlink.c +index ebffa8c80ffef..592e774ea0324 100644 +--- a/devlink/devlink.c ++++ b/devlink/devlink.c +@@ -6618,8 +6618,11 @@ static const char *health_state_name(uint8_t state) + } + } + +-static void format_logtime(uint64_t time_ms, char *ts_date, char *ts_time) ++static void pr_out_dump_reporter_format_logtime(struct dl *dl, const struct nlattr *attr) + { ++ char dump_date[HEALTH_REPORTER_TIMESTAMP_FMT_LEN]; ++ char dump_time[HEALTH_REPORTER_TIMESTAMP_FMT_LEN]; ++ uint64_t time_ms = mnl_attr_get_u64(attr); + struct sysinfo s_info; + struct tm *info; + time_t now, sec; +@@ -6637,16 +6640,16 @@ static void format_logtime(uint64_t time_ms, char *ts_date, char *ts_time) + sec = now - s_info.uptime + time_ms / 1000; + info = localtime(&sec); + out: +- strftime(ts_date, HEALTH_REPORTER_TIMESTAMP_FMT_LEN, "%Y-%m-%d", info); +- strftime(ts_time, HEALTH_REPORTER_TIMESTAMP_FMT_LEN, "%H:%M:%S", info); ++ strftime(dump_date, HEALTH_REPORTER_TIMESTAMP_FMT_LEN, "%Y-%m-%d", info); ++ strftime(dump_time, HEALTH_REPORTER_TIMESTAMP_FMT_LEN, "%H:%M:%S", info); ++ pr_out_str(dl, "last_dump_date", dump_date); ++ pr_out_str(dl, "last_dump_time", dump_time); + } + + static void pr_out_health(struct dl *dl, struct nlattr **tb_health) + { + struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {}; + enum devlink_health_reporter_state state; +- const struct nlattr *attr; +- uint64_t time_ms; + int err; + + err = mnl_attr_parse_nested(tb_health[DEVLINK_ATTR_HEALTH_REPORTER], +@@ -6674,17 +6677,8 @@ static void pr_out_health(struct dl *dl, struct nlattr **tb_health) + mnl_attr_get_u64(tb[DEVLINK_ATTR_HEALTH_REPORTER_ERR_COUNT])); + pr_out_u64(dl, "recover", + mnl_attr_get_u64(tb[DEVLINK_ATTR_HEALTH_REPORTER_RECOVER_COUNT])); +- if (tb[DEVLINK_ATTR_HEALTH_REPORTER_DUMP_TS]) { +- char dump_date[HEALTH_REPORTER_TIMESTAMP_FMT_LEN]; +- char dump_time[HEALTH_REPORTER_TIMESTAMP_FMT_LEN]; +- +- attr = tb[DEVLINK_ATTR_HEALTH_REPORTER_DUMP_TS]; +- time_ms = mnl_attr_get_u64(attr); +- format_logtime(time_ms, dump_date, dump_time); +- +- pr_out_str(dl, "last_dump_date", dump_date); +- pr_out_str(dl, "last_dump_time", dump_time); +- } ++ if (tb[DEVLINK_ATTR_HEALTH_REPORTER_DUMP_TS]) ++ pr_out_dump_reporter_format_logtime(dl, tb[DEVLINK_ATTR_HEALTH_REPORTER_DUMP_TS]); + if (tb[DEVLINK_ATTR_HEALTH_REPORTER_GRACEFUL_PERIOD]) + pr_out_u64(dl, "grace_period", + mnl_attr_get_u64(tb[DEVLINK_ATTR_HEALTH_REPORTER_GRACEFUL_PERIOD])); +-- +2.27.0 + diff --git a/0013-devlink-Add-a-new-time-stamp-format-for-health-repor.patch b/0013-devlink-Add-a-new-time-stamp-format-for-health-repor.patch new file mode 100644 index 0000000..59f4d06 --- /dev/null +++ b/0013-devlink-Add-a-new-time-stamp-format-for-health-repor.patch @@ -0,0 +1,65 @@ +From f4879d29863f0696de5673a4ca00b54523c831da Mon Sep 17 00:00:00 2001 +From: Aya Levin +Date: Wed, 11 Dec 2019 17:45:35 +0200 +Subject: [PATCH] devlink: Add a new time-stamp format for health reporter's + dump + +Introduce a new attribute representing a new time-stamp format: current +time in ns (to comply with y2038) instead of jiffies. If the new +attribute was received, translate the time-stamp accordingly (ns). + +Fixes: 2f1242efe9d0 ("devlink: Add devlink health show command") +Signed-off-by: Aya Levin +Acked-by: Jiri Pirko +Signed-off-by: Tariq Toukan +Signed-off-by: Stephen Hemminger +(cherry picked from commit 746b66b005782dc9621f4fc84d0a1859300a6d01) +Signed-off-by: Phil Sutter +--- + devlink/devlink.c | 23 ++++++++++++++++++++++- + 1 file changed, 22 insertions(+), 1 deletion(-) + +diff --git a/devlink/devlink.c b/devlink/devlink.c +index 592e774ea0324..4a01b0a8f6b88 100644 +--- a/devlink/devlink.c ++++ b/devlink/devlink.c +@@ -6646,6 +6646,25 @@ out: + pr_out_str(dl, "last_dump_time", dump_time); + } + ++static void pr_out_dump_report_timestamp(struct dl *dl, const struct nlattr *attr) ++{ ++ char dump_date[HEALTH_REPORTER_TIMESTAMP_FMT_LEN]; ++ char dump_time[HEALTH_REPORTER_TIMESTAMP_FMT_LEN]; ++ time_t tv_sec; ++ struct tm *tm; ++ uint64_t ts; ++ ++ ts = mnl_attr_get_u64(attr); ++ tv_sec = ts / 1000000000; ++ tm = localtime(&tv_sec); ++ ++ strftime(dump_date, HEALTH_REPORTER_TIMESTAMP_FMT_LEN, "%Y-%m-%d", tm); ++ strftime(dump_time, HEALTH_REPORTER_TIMESTAMP_FMT_LEN, "%H:%M:%S", tm); ++ ++ pr_out_str(dl, "last_dump_date", dump_date); ++ pr_out_str(dl, "last_dump_time", dump_time); ++} ++ + static void pr_out_health(struct dl *dl, struct nlattr **tb_health) + { + struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {}; +@@ -6677,7 +6696,9 @@ static void pr_out_health(struct dl *dl, struct nlattr **tb_health) + mnl_attr_get_u64(tb[DEVLINK_ATTR_HEALTH_REPORTER_ERR_COUNT])); + pr_out_u64(dl, "recover", + mnl_attr_get_u64(tb[DEVLINK_ATTR_HEALTH_REPORTER_RECOVER_COUNT])); +- if (tb[DEVLINK_ATTR_HEALTH_REPORTER_DUMP_TS]) ++ if (tb[DEVLINK_ATTR_HEALTH_REPORTER_DUMP_TS_NS]) ++ pr_out_dump_report_timestamp(dl, tb[DEVLINK_ATTR_HEALTH_REPORTER_DUMP_TS_NS]); ++ else if (tb[DEVLINK_ATTR_HEALTH_REPORTER_DUMP_TS]) + pr_out_dump_reporter_format_logtime(dl, tb[DEVLINK_ATTR_HEALTH_REPORTER_DUMP_TS]); + if (tb[DEVLINK_ATTR_HEALTH_REPORTER_GRACEFUL_PERIOD]) + pr_out_u64(dl, "grace_period", +-- +2.27.0 + diff --git a/0014-devlink-Fix-fmsg-nesting-in-non-JSON-output.patch b/0014-devlink-Fix-fmsg-nesting-in-non-JSON-output.patch new file mode 100644 index 0000000..c03f4a8 --- /dev/null +++ b/0014-devlink-Fix-fmsg-nesting-in-non-JSON-output.patch @@ -0,0 +1,250 @@ +From 7f80e4520b72a6063e5db3f4507ad9f8f90a9176 Mon Sep 17 00:00:00 2001 +From: Aya Levin +Date: Wed, 11 Dec 2019 17:45:36 +0200 +Subject: [PATCH] devlink: Fix fmsg nesting in non JSON output + +When an object or an array opening follows a name (label), add a new +line and indentation before printing the label. When name (label) is +followed by a value, print both at the same line. + +Prior to this patch nesting was not visible in a non JSON output: +JSON: +{ + "Common config": { + "SQ": { + "stride size": 64, + "size": 1024 + }, + "CQ": { + "stride size": 64, + "size": 1024 + } }, + "SQs": [ { + "channel ix": 0, + "sqn": 10, + "HW state": 1, + "stopped": false, + "cc": 0, + "pc": 0, + "CQ": { + "cqn": 6, + "HW status": 0 + } + },{ + "channel ix": 0, + "sqn": 14, + "HW state": 1, + "stopped": false, + "cc": 0, + "pc": 0, + "CQ": { + "cqn": 10, + "HW status": 0 + } + } ] +} + +Before this patch: +Common Config: SQ: stride size: 64 size: 1024 +CQ: stride size: 64 size: 1024 +SQs: + channel ix: 0 tc: 0 txq ix: 0 sqn: 10 HW state: 1 stopped: false cc: 0 pc: 0 CQ: cqn: 6 HW status: 0 + channel ix: 1 tc: 0 txq ix: 1 sqn: 14 HW state: 1 stopped: false cc: 0 pc: 0 CQ: cqn: 10 HW status: 0 + +With this patch: +Common config: + SQ: + stride size: 64 size: 1024 + CQ: + stride size: 64 size: 1024 +SQs: + channel ix: 0 sqn: 10 HW state: 1 stopped: false cc: 0 pc: 0 + CQ: + cqn: 6 HW status: 0 + channel ix: 1 sqn: 14 HW state: 1 stopped: false cc: 0 pc: 0 + CQ: + cqn: 10 HW status: 0 + +Fixes: 7b8baf834d5e ("devlink: Add devlink health diagnose command") +Signed-off-by: Aya Levin +Acked-by: Jiri Pirko +Signed-off-by: Tariq Toukan +Signed-off-by: Stephen Hemminger +(cherry picked from commit af646bf95381964187d1128999c3265073609fe3) +Signed-off-by: Phil Sutter +--- + devlink/devlink.c | 106 ++++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 88 insertions(+), 18 deletions(-) + +diff --git a/devlink/devlink.c b/devlink/devlink.c +index 4a01b0a8f6b88..9bbc223c12973 100644 +--- a/devlink/devlink.c ++++ b/devlink/devlink.c +@@ -6427,12 +6427,23 @@ static int fmsg_value_show(struct dl *dl, int type, struct nlattr *nl_data) + return MNL_CB_OK; + } + ++static void pr_out_fmsg_name(struct dl *dl, char **name) ++{ ++ if (!*name) ++ return; ++ ++ pr_out_name(dl, *name); ++ free(*name); ++ *name = NULL; ++} ++ + struct nest_entry { + int attr_type; + struct list_head list; + }; + + struct fmsg_cb_data { ++ char *name; + struct dl *dl; + uint8_t value_type; + struct list_head entry_list; +@@ -6462,6 +6473,56 @@ static int cmd_fmsg_nest_queue(struct fmsg_cb_data *fmsg_data, + return MNL_CB_OK; + } + ++static void pr_out_fmsg_group_start(struct dl *dl, char **name) ++{ ++ __pr_out_newline(); ++ pr_out_fmsg_name(dl, name); ++ __pr_out_newline(); ++ __pr_out_indent_inc(); ++} ++ ++static void pr_out_fmsg_group_end(struct dl *dl) ++{ ++ __pr_out_newline(); ++ __pr_out_indent_dec(); ++} ++ ++static void pr_out_fmsg_start_object(struct dl *dl, char **name) ++{ ++ if (dl->json_output) { ++ pr_out_fmsg_name(dl, name); ++ jsonw_start_object(dl->jw); ++ } else { ++ pr_out_fmsg_group_start(dl, name); ++ } ++} ++ ++static void pr_out_fmsg_end_object(struct dl *dl) ++{ ++ if (dl->json_output) ++ jsonw_end_object(dl->jw); ++ else ++ pr_out_fmsg_group_end(dl); ++} ++ ++static void pr_out_fmsg_start_array(struct dl *dl, char **name) ++{ ++ if (dl->json_output) { ++ pr_out_fmsg_name(dl, name); ++ jsonw_start_array(dl->jw); ++ } else { ++ pr_out_fmsg_group_start(dl, name); ++ } ++} ++ ++static void pr_out_fmsg_end_array(struct dl *dl) ++{ ++ if (dl->json_output) ++ jsonw_end_array(dl->jw); ++ else ++ pr_out_fmsg_group_end(dl); ++} ++ + static int cmd_fmsg_nest(struct fmsg_cb_data *fmsg_data, uint8_t nest_value, + bool start) + { +@@ -6476,26 +6537,17 @@ static int cmd_fmsg_nest(struct fmsg_cb_data *fmsg_data, uint8_t nest_value, + switch (value) { + case DEVLINK_ATTR_FMSG_OBJ_NEST_START: + if (start) +- pr_out_entry_start(dl); ++ pr_out_fmsg_start_object(dl, &fmsg_data->name); + else +- pr_out_entry_end(dl); ++ pr_out_fmsg_end_object(dl); + break; + case DEVLINK_ATTR_FMSG_PAIR_NEST_START: + break; + case DEVLINK_ATTR_FMSG_ARR_NEST_START: +- if (dl->json_output) { +- if (start) +- jsonw_start_array(dl->jw); +- else +- jsonw_end_array(dl->jw); +- } else { +- if (start) { +- __pr_out_newline(); +- __pr_out_indent_inc(); +- } else { +- __pr_out_indent_dec(); +- } +- } ++ if (start) ++ pr_out_fmsg_start_array(dl, &fmsg_data->name); ++ else ++ pr_out_fmsg_end_array(dl); + break; + default: + return -EINVAL; +@@ -6533,12 +6585,16 @@ static int cmd_fmsg_object_cb(const struct nlmsghdr *nlh, void *data) + return err; + break; + case DEVLINK_ATTR_FMSG_OBJ_NAME: +- pr_out_name(dl, mnl_attr_get_str(nla_object)); ++ free(fmsg_data->name); ++ fmsg_data->name = strdup(mnl_attr_get_str(nla_object)); ++ if (!fmsg_data->name) ++ return -ENOMEM; + break; + case DEVLINK_ATTR_FMSG_OBJ_VALUE_TYPE: + fmsg_data->value_type = mnl_attr_get_u8(nla_object); + break; + case DEVLINK_ATTR_FMSG_OBJ_VALUE_DATA: ++ pr_out_fmsg_name(dl, &fmsg_data->name); + err = fmsg_value_show(dl, fmsg_data->value_type, + nla_object); + if (err != MNL_CB_OK) +@@ -6551,6 +6607,20 @@ static int cmd_fmsg_object_cb(const struct nlmsghdr *nlh, void *data) + return MNL_CB_OK; + } + ++static void cmd_fmsg_init(struct dl *dl, struct fmsg_cb_data *data) ++{ ++ /* FMSG is dynamic: opening of an object or array causes a ++ * newline. JSON starts with an { or [, but plain text should ++ * not start with a new line. Ensure this by setting ++ * g_new_line_count to 1: avoiding newline before the first ++ * print. ++ */ ++ g_new_line_count = 1; ++ data->name = NULL; ++ data->dl = dl; ++ INIT_LIST_HEAD(&data->entry_list); ++} ++ + static int cmd_health_object_common(struct dl *dl, uint8_t cmd, uint16_t flags) + { + struct fmsg_cb_data data; +@@ -6564,9 +6634,9 @@ static int cmd_health_object_common(struct dl *dl, uint8_t cmd, uint16_t flags) + if (err) + return err; + +- data.dl = dl; +- INIT_LIST_HEAD(&data.entry_list); ++ cmd_fmsg_init(dl, &data); + err = _mnlg_socket_sndrcv(dl->nlg, nlh, cmd_fmsg_object_cb, &data); ++ free(data.name); + return err; + } + +-- +2.27.0 + diff --git a/0015-ip-xfrm-if_id-ve-value-is-error.patch b/0015-ip-xfrm-if_id-ve-value-is-error.patch new file mode 100644 index 0000000..547393c --- /dev/null +++ b/0015-ip-xfrm-if_id-ve-value-is-error.patch @@ -0,0 +1,45 @@ +From 0b3206b57515ed544a4151bd05bb5fb02651bb1b Mon Sep 17 00:00:00 2001 +From: Antony Antony +Date: Thu, 19 Dec 2019 15:18:03 +0100 +Subject: [PATCH] ip: xfrm if_id -ve value is error + +if_id is u32, error on -ve values instead of setting to 0 + +after : + ip link add ipsec1 type xfrm dev lo if_id -10 + Error: argument "-10" is wrong: if_id value is invalid + +before : note xfrm if_id 0 + ip link add ipsec1 type xfrm dev lo if_id -10 + ip -d link show dev ipsec1 + 9: ipsec1@lo: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 + link/none 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 1500 + xfrm if_id 0 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 + +Fixes: 286446c1e8c ("ip: support for xfrm interfaces") +Signed-off-by: Antony Antony +Signed-off-by: Stephen Hemminger +(cherry picked from commit 2cf4d7af72e308fe40acef5788d1890b6b966035) +Signed-off-by: Phil Sutter +--- + ip/link_xfrm.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/ip/link_xfrm.c b/ip/link_xfrm.c +index a28f308d56104..7dbfb13f88d68 100644 +--- a/ip/link_xfrm.c ++++ b/ip/link_xfrm.c +@@ -37,7 +37,9 @@ static int xfrm_parse_opt(struct link_util *lu, int argc, char **argv, + exit(nodev(*argv)); + } else if (!matches(*argv, "if_id")) { + NEXT_ARG(); +- if (!get_u32(&if_id, *argv, 0)) ++ if (get_u32(&if_id, *argv, 0)) ++ invarg("if_id value is invalid", *argv); ++ else + addattr32(n, 1024, IFLA_XFRM_IF_ID, if_id); + } else { + xfrm_print_help(lu, argc, argv, stderr); +-- +2.27.0 + diff --git a/0016-tc-fq_codel-fix-missing-statistic-in-JSON-output.patch b/0016-tc-fq_codel-fix-missing-statistic-in-JSON-output.patch new file mode 100644 index 0000000..9f77145 --- /dev/null +++ b/0016-tc-fq_codel-fix-missing-statistic-in-JSON-output.patch @@ -0,0 +1,43 @@ +From dd3c87f75ca1ef88384ce3f0e301763569bba89f Mon Sep 17 00:00:00 2001 +From: Leslie Monis +Date: Thu, 26 Dec 2019 00:34:18 +0530 +Subject: [PATCH] tc: fq_codel: fix missing statistic in JSON output +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Print JSON object even if tc_fq_codel_xstats->class_stats.drop_next +is negative. + +Cc: Toke Høiland-Jørgensen +Fixes: 997f2dc19378 ("tc: Add JSON output of fq_codel stats") +Signed-off-by: Leslie Monis +Signed-off-by: Stephen Hemminger +(cherry picked from commit e819d3a03dd19ed3dd0f50bd128f62f972e8240f) +Signed-off-by: Phil Sutter +--- + tc/q_fq_codel.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tc/q_fq_codel.c b/tc/q_fq_codel.c +index 376ac50da1a5d..d002940da6b78 100644 +--- a/tc/q_fq_codel.c ++++ b/tc/q_fq_codel.c +@@ -275,12 +275,12 @@ static int fq_codel_print_xstats(struct qdisc_util *qu, FILE *f, + sprint_time(st->class_stats.ldelay, b1)); + if (st->class_stats.dropping) { + print_bool(PRINT_ANY, "dropping", " dropping", true); ++ print_int(PRINT_JSON, "drop_next", NULL, ++ st->class_stats.drop_next); + if (st->class_stats.drop_next < 0) + print_string(PRINT_FP, NULL, " drop_next -%s", + sprint_time(-st->class_stats.drop_next, b1)); + else { +- print_uint(PRINT_JSON, "drop_next", NULL, +- st->class_stats.drop_next); + print_string(PRINT_FP, NULL, " drop_next %s", + sprint_time(st->class_stats.drop_next, b1)); + } +-- +2.27.0 + diff --git a/0017-ip-fix-link-type-and-vlan-oneline-output.patch b/0017-ip-fix-link-type-and-vlan-oneline-output.patch new file mode 100644 index 0000000..84752ab --- /dev/null +++ b/0017-ip-fix-link-type-and-vlan-oneline-output.patch @@ -0,0 +1,59 @@ +From 0b58868630b873209f0aed7116470174acdfa3f4 Mon Sep 17 00:00:00 2001 +From: Vladis Dronov +Date: Sun, 19 Jan 2020 02:12:51 +0100 +Subject: [PATCH] ip: fix link type and vlan oneline output + +Move link type printing in print_linkinfo() so multiline output does not +break link options line. Add oneline support for vlan's ingress and egress +qos maps. + +Before the fix: + +5: veth90.4000@veth90: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 + link/ether 26:9a:05:af:db:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 0 maxmtu 65535 + vlan protocol 802.1Q id 4000 the option line is broken ^^^ + ingress-qos-map { 1:2 } + egress-qos-map { 2:1 } addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 + +5: veth90.4000@veth90: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000\ link/ether 26:9a:05:af:db:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 0 maxmtu 65535 \ vlan protocol 802.1Q id 4000 + ingress-qos-map { 1:2 } <<< a multiline output despite -oneline + egress-qos-map { 2:1 } addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 + +After the fix: + +5: veth90.4000@veth90: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 + link/ether 26:9a:05:af:db:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 0 maxmtu 65535 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 + vlan protocol 802.1Q id 4000 + ingress-qos-map { 1:2 } + egress-qos-map { 2:1 } + +5: veth90.4000@veth90: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000\ link/ether 26:9a:05:af:db:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 0 maxmtu 65535 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 \ vlan protocol 802.1Q id 4000 \ ingress-qos-map { 1:2 } \ egress-qos-map { 2:1 } + +Fixes: 5c302d518f10 ("vlan support") +Link: https://bugzilla.kernel.org/show_bug.cgi?id=206241 +Reported-by: George Shuklin +Signed-off-by: Vladis Dronov +Signed-off-by: Stephen Hemminger +(cherry picked from commit 970db267a0fb5036b28b2d9d4f53cb4be267ffd5) +Signed-off-by: Phil Sutter +--- + ip/iplink_vlan.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/ip/iplink_vlan.c b/ip/iplink_vlan.c +index 0dfb4a8d536ca..1e6817f5de3d2 100644 +--- a/ip/iplink_vlan.c ++++ b/ip/iplink_vlan.c +@@ -183,7 +183,8 @@ static void vlan_print_map(FILE *f, + int rem; + + open_json_array(PRINT_JSON, name_json); +- print_string(PRINT_FP, NULL, "\n %s { ", name_fp); ++ print_nl(); ++ print_string(PRINT_FP, NULL, " %s { ", name_fp); + + rem = RTA_PAYLOAD(attr); + for (i = RTA_DATA(attr); RTA_OK(i, rem); i = RTA_NEXT(i, rem)) { +-- +2.27.0 + diff --git a/0018-ip-xfrm-Fix-help-messages.patch b/0018-ip-xfrm-Fix-help-messages.patch new file mode 100644 index 0000000..2e57ee7 --- /dev/null +++ b/0018-ip-xfrm-Fix-help-messages.patch @@ -0,0 +1,101 @@ +From f3f38b7d189675c37d04876b23ba6d38bbded5e1 Mon Sep 17 00:00:00 2001 +From: Andrea Claudi +Date: Wed, 29 Jan 2020 15:56:40 +0100 +Subject: [PATCH] ip-xfrm: Fix help messages + +After commit 8589eb4efdf2a ("treewide: refactor help messages") help +messages for xfrm state and policy are broken, printing many times the +same protocol in UPSPEC section: + +$ ip xfrm state help +[...] +UPSPEC := proto { { tcp | tcp | tcp | tcp } [ sport PORT ] [ dport PORT ] | + { icmp | icmp | icmp } [ type NUMBER ] [ code NUMBER ] | + gre [ key { DOTTED-QUAD | NUMBER } ] | PROTO } + +This happens because strxf_proto function is non-reentrant and gets called +multiple times in the same fprintf instruction. + +This commit fix the issue avoiding calls to strxf_proto() with a constant +param, just hardcoding strings for protocol names. + +Fixes: 8589eb4efdf2a ("treewide: refactor help messages") +Signed-off-by: Andrea Claudi +Signed-off-by: Stephen Hemminger +(cherry picked from commit 38dd041bfe773e481ebf9c8250e49c665af2e215) +Signed-off-by: Phil Sutter +--- + ip/xfrm_policy.c | 21 +++------------------ + ip/xfrm_state.c | 24 +++--------------------- + 2 files changed, 6 insertions(+), 39 deletions(-) + +diff --git a/ip/xfrm_policy.c b/ip/xfrm_policy.c +index 7c0233c182902..d3c706d3225f0 100644 +--- a/ip/xfrm_policy.c ++++ b/ip/xfrm_policy.c +@@ -66,24 +66,9 @@ static void usage(void) + "Usage: ip xfrm policy count\n" + "Usage: ip xfrm policy set [ hthresh4 LBITS RBITS ] [ hthresh6 LBITS RBITS ]\n" + "SELECTOR := [ src ADDR[/PLEN] ] [ dst ADDR[/PLEN] ] [ dev DEV ] [ UPSPEC ]\n" +- "UPSPEC := proto { { "); +- fprintf(stderr, "%s | %s | %s | %s } ", +- strxf_proto(IPPROTO_TCP), +- strxf_proto(IPPROTO_UDP), +- strxf_proto(IPPROTO_SCTP), +- strxf_proto(IPPROTO_DCCP)); +- fprintf(stderr, +- "[ sport PORT ] [ dport PORT ] |\n" +- " { %s | %s | %s } ", +- strxf_proto(IPPROTO_ICMP), +- strxf_proto(IPPROTO_ICMPV6), +- strxf_proto(IPPROTO_MH)); +- fprintf(stderr, +- "[ type NUMBER ] [ code NUMBER ] |\n" +- " %s", +- strxf_proto(IPPROTO_GRE)); +- fprintf(stderr, +- " [ key { DOTTED-QUAD | NUMBER } ] | PROTO }\n" ++ "UPSPEC := proto { { tcp | udp | sctp | dccp } [ sport PORT ] [ dport PORT ] |\n" ++ " { icmp | ipv6-icmp | mobility-header } [ type NUMBER ] [ code NUMBER ] |\n" ++ " gre [ key { DOTTED-QUAD | NUMBER } ] | PROTO }\n" + "DIR := in | out | fwd\n" + "PTYPE := main | sub\n" + "ACTION := allow | block\n" +diff --git a/ip/xfrm_state.c b/ip/xfrm_state.c +index b03ccc5807e90..7b413cd9b9a22 100644 +--- a/ip/xfrm_state.c ++++ b/ip/xfrm_state.c +@@ -106,27 +106,9 @@ static void usage(void) + "EXTRA-FLAG-LIST := [ EXTRA-FLAG-LIST ] EXTRA-FLAG\n" + "EXTRA-FLAG := dont-encap-dscp\n" + "SELECTOR := [ src ADDR[/PLEN] ] [ dst ADDR[/PLEN] ] [ dev DEV ] [ UPSPEC ]\n" +- "UPSPEC := proto { { "); +- fprintf(stderr, +- "%s | %s | %s | %s", +- strxf_proto(IPPROTO_TCP), +- strxf_proto(IPPROTO_UDP), +- strxf_proto(IPPROTO_SCTP), +- strxf_proto(IPPROTO_DCCP)); +- fprintf(stderr, +- " } [ sport PORT ] [ dport PORT ] |\n" +- " { "); +- fprintf(stderr, +- "%s | %s | %s", +- strxf_proto(IPPROTO_ICMP), +- strxf_proto(IPPROTO_ICMPV6), +- strxf_proto(IPPROTO_MH)); +- fprintf(stderr, +- " } [ type NUMBER ] [ code NUMBER ] |\n"); +- fprintf(stderr, +- " %s", strxf_proto(IPPROTO_GRE)); +- fprintf(stderr, +- " [ key { DOTTED-QUAD | NUMBER } ] | PROTO }\n" ++ "UPSPEC := proto { { tcp | udp | sctp | dccp } [ sport PORT ] [ dport PORT ] |\n" ++ " { icmp | ipv6-icmp | mobility-header } [ type NUMBER ] [ code NUMBER ] |\n" ++ " gre [ key { DOTTED-QUAD | NUMBER } ] | PROTO }\n" + "LIMIT-LIST := [ LIMIT-LIST ] limit LIMIT\n" + "LIMIT := { time-soft | time-hard | time-use-soft | time-use-hard } SECONDS |\n" + " { byte-soft | byte-hard } SIZE | { packet-soft | packet-hard } COUNT\n" +-- +2.27.0 + diff --git a/0019-ip-link-xstats-fix-TX-IGMP-reports-string.patch b/0019-ip-link-xstats-fix-TX-IGMP-reports-string.patch new file mode 100644 index 0000000..857e232 --- /dev/null +++ b/0019-ip-link-xstats-fix-TX-IGMP-reports-string.patch @@ -0,0 +1,33 @@ +From e7b786e573c31a2a2578cb6da37309828a469355 Mon Sep 17 00:00:00 2001 +From: Andrea Claudi +Date: Wed, 29 Jan 2020 15:31:11 +0100 +Subject: [PATCH] ip link: xstats: fix TX IGMP reports string + +This restore the string format we have before jsonification, adding a +missing space between v2 and v3 on TX IGMP reports string. + +Fixes: a9bc23a79227a ("ip: bridge: add xstats json support") +Signed-off-by: Andrea Claudi +Signed-off-by: Stephen Hemminger +(cherry picked from commit 5cdeb77cd6ec26f0a7103dfb21494a6a43903206) +Signed-off-by: Phil Sutter +--- + ip/iplink_bridge.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c +index 06f736d4dc710..868ea6e266ebe 100644 +--- a/ip/iplink_bridge.c ++++ b/ip/iplink_bridge.c +@@ -742,7 +742,7 @@ static void bridge_print_stats_attr(struct rtattr *attr, int ifindex) + print_string(PRINT_FP, NULL, "%-16s ", ""); + print_u64(PRINT_ANY, "tx_v1", "TX: v1 %llu ", + mstats->igmp_v1reports[BR_MCAST_DIR_TX]); +- print_u64(PRINT_ANY, "tx_v2", "v2 %llu", ++ print_u64(PRINT_ANY, "tx_v2", "v2 %llu ", + mstats->igmp_v2reports[BR_MCAST_DIR_TX]); + print_u64(PRINT_ANY, "tx_v3", "v3 %llu\n", + mstats->igmp_v3reports[BR_MCAST_DIR_TX]); +-- +2.27.0 + diff --git a/0020-devlink-fix-warning-from-unchecked-write.patch b/0020-devlink-fix-warning-from-unchecked-write.patch new file mode 100644 index 0000000..4777daa --- /dev/null +++ b/0020-devlink-fix-warning-from-unchecked-write.patch @@ -0,0 +1,46 @@ +From 245ea7ad77e299a2aee98c6d91678f4243e08f40 Mon Sep 17 00:00:00 2001 +From: Stephen Hemminger +Date: Sun, 2 Feb 2020 04:20:58 -0800 +Subject: [PATCH] devlink: fix warning from unchecked write +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Warning seen on Ubuntu + +devlink.c: In function ‘cmd_dev_flash’: +devlink.c:3071:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] + 3071 | write(pipe_w, &err, sizeof(err)); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Fixes: 9b13cddfe268 ("devlink: implement flash status monitoring") +Signed-off-by: Stephen Hemminger +(cherry picked from commit 8f9f2b9cdfbd1c7988542d81db1db854d48f2b0d) +Signed-off-by: Phil Sutter +--- + devlink/devlink.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/devlink/devlink.c b/devlink/devlink.c +index 9bbc223c12973..9d6a3cd14bc26 100644 +--- a/devlink/devlink.c ++++ b/devlink/devlink.c +@@ -3074,11 +3074,13 @@ static int cmd_dev_flash(struct dl *dl) + /* In child, just execute the flash and pass returned + * value through pipe once it is done. + */ ++ int cc; ++ + close(pipe_r); + err = _mnlg_socket_send(dl->nlg, nlh); +- write(pipe_w, &err, sizeof(err)); ++ cc = write(pipe_w, &err, sizeof(err)); + close(pipe_w); +- exit(0); ++ exit(cc != sizeof(err)); + } + close(pipe_w); + +-- +2.27.0 + diff --git a/0021-erspan-set-erspan_ver-to-1-by-default.patch b/0021-erspan-set-erspan_ver-to-1-by-default.patch new file mode 100644 index 0000000..8498f6d --- /dev/null +++ b/0021-erspan-set-erspan_ver-to-1-by-default.patch @@ -0,0 +1,61 @@ +From a17b512a6a706906b559a5b9a1b52507a976862b Mon Sep 17 00:00:00 2001 +From: Xin Long +Date: Tue, 18 Feb 2020 11:50:20 +0800 +Subject: [PATCH] erspan: set erspan_ver to 1 by default + +Commit 289763626721 ("erspan: add erspan version II support") +breaks the command: + + # ip link add erspan1 type erspan key 1 seq erspan 123 \ + local 10.1.0.2 remote 10.1.0.1 + +as erspan_ver is set to 0 by default, then IFLA_GRE_ERSPAN_INDEX +won't be set in gre_parse_opt(). + + # ip -d link show erspan1 + ... + erspan remote 10.1.0.1 local 10.1.0.2 ... erspan_index 0 erspan_ver 1 + ^^^^^^^^^^^^^^ + +This patch is to change to set erspan_ver to 1 by default. + +Fixes: 289763626721 ("erspan: add erspan version II support") +Signed-off-by: Xin Long +Acked-by: William Tu +Signed-off-by: Stephen Hemminger +(cherry picked from commit 83c543af872e38654326671f6b504257d98c4489) +Signed-off-by: Phil Sutter +--- + ip/link_gre.c | 2 +- + ip/link_gre6.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/ip/link_gre.c b/ip/link_gre.c +index 15beb737217e8..e42f21ae4556c 100644 +--- a/ip/link_gre.c ++++ b/ip/link_gre.c +@@ -94,7 +94,7 @@ static int gre_parse_opt(struct link_util *lu, int argc, char **argv, + __u8 metadata = 0; + __u32 fwmark = 0; + __u32 erspan_idx = 0; +- __u8 erspan_ver = 0; ++ __u8 erspan_ver = 1; + __u8 erspan_dir = 0; + __u16 erspan_hwid = 0; + +diff --git a/ip/link_gre6.c b/ip/link_gre6.c +index 9d1741bff8a16..94a4ee700431c 100644 +--- a/ip/link_gre6.c ++++ b/ip/link_gre6.c +@@ -106,7 +106,7 @@ static int gre_parse_opt(struct link_util *lu, int argc, char **argv, + __u8 metadata = 0; + __u32 fwmark = 0; + __u32 erspan_idx = 0; +- __u8 erspan_ver = 0; ++ __u8 erspan_ver = 1; + __u8 erspan_dir = 0; + __u16 erspan_hwid = 0; + +-- +2.27.0 + diff --git a/0022-xfrm-not-try-to-delete-ipcomp-states-when-using-dele.patch b/0022-xfrm-not-try-to-delete-ipcomp-states-when-using-dele.patch new file mode 100644 index 0000000..7385172 --- /dev/null +++ b/0022-xfrm-not-try-to-delete-ipcomp-states-when-using-dele.patch @@ -0,0 +1,48 @@ +From 2e0e4bf6638fb7d24da17c4a09fc2a1df79579c5 Mon Sep 17 00:00:00 2001 +From: Xin Long +Date: Mon, 24 Feb 2020 09:57:01 -0500 +Subject: [PATCH] xfrm: not try to delete ipcomp states when using deleteall + +In kernel space, ipcomp(sub) states used by main states are not +allowed to be deleted by users, they would be freed only when +all main states are destroyed and no one uses them. + +In user space, ip xfrm sta deleteall doesn't filter these ipcomp +states out, and it causes errors: + + # ip xfrm state add src 192.168.0.1 dst 192.168.0.2 spi 0x1000 \ + proto comp comp deflate mode tunnel sel src 192.168.0.1 dst \ + 192.168.0.2 proto gre + # ip xfrm sta deleteall + Failed to send delete-all request + : Operation not permitted + +This patch is to fix it by filtering ipcomp states with a check +xsinfo->id.proto == IPPROTO_IPIP. + +Fixes: c7699875bee0 ("Import patch ipxfrm-20040707_2.diff") +Signed-off-by: Xin Long +Signed-off-by: Stephen Hemminger +(cherry picked from commit f9d696cf414c2c475764aa3b29cf288350f1e21f) +Signed-off-by: Phil Sutter +--- + ip/xfrm_state.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/ip/xfrm_state.c b/ip/xfrm_state.c +index 7b413cd9b9a22..d014444e9af4f 100644 +--- a/ip/xfrm_state.c ++++ b/ip/xfrm_state.c +@@ -1131,6 +1131,9 @@ static int xfrm_state_keep(struct nlmsghdr *n, void *arg) + if (!xfrm_state_filter_match(xsinfo)) + return 0; + ++ if (xsinfo->id.proto == IPPROTO_IPIP) ++ return 0; ++ + if (xb->offset > xb->size) { + fprintf(stderr, "State buffer overflow\n"); + return -1; +-- +2.27.0 + diff --git a/0023-nexthop-fix-error-reporting-in-filter-dump.patch b/0023-nexthop-fix-error-reporting-in-filter-dump.patch new file mode 100644 index 0000000..affbb45 --- /dev/null +++ b/0023-nexthop-fix-error-reporting-in-filter-dump.patch @@ -0,0 +1,41 @@ +From 81bd99800256801a8cca965ff3689dbcd71a336f Mon Sep 17 00:00:00 2001 +From: Andrea Claudi +Date: Tue, 10 Mar 2020 13:15:17 +0100 +Subject: [PATCH] nexthop: fix error reporting in filter dump + +nh_dump_filter is missing a return value check in two cases. +Fix this simply adding an assignment to the proper variable. + +Fixes: 63df8e8543b03 ("Add support for nexthop objects") +Signed-off-by: Andrea Claudi +Reviewed-by: David Ahern +Signed-off-by: Stephen Hemminger +(cherry picked from commit d9b868436a6fce8986560178c6d1a78072e21861) +Signed-off-by: Phil Sutter +--- + ip/ipnexthop.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/ip/ipnexthop.c b/ip/ipnexthop.c +index 9f860c8cea251..99f89630ed189 100644 +--- a/ip/ipnexthop.c ++++ b/ip/ipnexthop.c +@@ -59,13 +59,13 @@ static int nh_dump_filter(struct nlmsghdr *nlh, int reqlen) + } + + if (filter.groups) { +- addattr_l(nlh, reqlen, NHA_GROUPS, NULL, 0); ++ err = addattr_l(nlh, reqlen, NHA_GROUPS, NULL, 0); + if (err) + return err; + } + + if (filter.master) { +- addattr32(nlh, reqlen, NHA_MASTER, filter.master); ++ err = addattr32(nlh, reqlen, NHA_MASTER, filter.master); + if (err) + return err; + } +-- +2.27.0 + diff --git a/0024-ip-link_gre-Do-not-send-ERSPAN-attributes-to-GRE-tun.patch b/0024-ip-link_gre-Do-not-send-ERSPAN-attributes-to-GRE-tun.patch new file mode 100644 index 0000000..b5d2f7a --- /dev/null +++ b/0024-ip-link_gre-Do-not-send-ERSPAN-attributes-to-GRE-tun.patch @@ -0,0 +1,121 @@ +From 2ffe12bb7de9805d4ab2f0c0f9614d00f9f82dc2 Mon Sep 17 00:00:00 2001 +From: Petr Machata +Date: Sat, 4 Apr 2020 01:55:34 +0300 +Subject: [PATCH] ip: link_gre: Do not send ERSPAN attributes to GRE tunnels + +In the commit referenced below, ip link started sending ERSPAN-specific +attributes even for GRE and gretap tunnels. Fix by more carefully +distinguishing between the GRE/tap and ERSPAN modes. Do not show +ERSPAN-related help in GRE/tap mode, likewise do not accept ERSPAN +arguments, or send ERSPAN attributes. + +Fixes: 83c543af872e ("erspan: set erspan_ver to 1 by default") +Signed-off-by: Petr Machata +Acked-by: William Tu +Signed-off-by: Stephen Hemminger +(cherry picked from commit 20927e0525e0cca165cd1252ac18da07cb082c4d) +Signed-off-by: Phil Sutter +--- + ip/link_gre.c | 34 ++++++++++++++++++++++------------ + 1 file changed, 22 insertions(+), 12 deletions(-) + +diff --git a/ip/link_gre.c b/ip/link_gre.c +index e42f21ae4556c..d616a970e9a28 100644 +--- a/ip/link_gre.c ++++ b/ip/link_gre.c +@@ -23,8 +23,15 @@ + #include "ip_common.h" + #include "tunnel.h" + ++static bool gre_is_erspan(struct link_util *lu) ++{ ++ return !strcmp(lu->id, "erspan"); ++} ++ + static void gre_print_help(struct link_util *lu, int argc, char **argv, FILE *f) + { ++ bool is_erspan = gre_is_erspan(lu); ++ + fprintf(f, + "Usage: ... %-9s [ remote ADDR ]\n" + " [ local ADDR ]\n" +@@ -44,18 +51,20 @@ static void gre_print_help(struct link_util *lu, int argc, char **argv, FILE *f) + " [ encap-dport PORT ]\n" + " [ [no]encap-csum ]\n" + " [ [no]encap-csum6 ]\n" +- " [ [no]encap-remcsum ]\n" +- " [ erspan_ver version ]\n" +- " [ erspan IDX ]\n" +- " [ erspan_dir { ingress | egress } ]\n" +- " [ erspan_hwid hwid ]\n" ++ " [ [no]encap-remcsum ]\n", lu->id); ++ if (is_erspan) ++ fprintf(f, ++ " [ erspan_ver version ]\n" ++ " [ erspan IDX ]\n" ++ " [ erspan_dir { ingress | egress } ]\n" ++ " [ erspan_hwid hwid ]\n"); ++ fprintf(f, + "\n" + "Where: ADDR := { IP_ADDRESS | any }\n" + " TOS := { NUMBER | inherit }\n" + " TTL := { 1..255 | inherit }\n" + " KEY := { DOTTED_QUAD | NUMBER }\n" +- " MARK := { 0x0..0xffffffff }\n", +- lu->id); ++ " MARK := { 0x0..0xffffffff }\n"); + } + + static int gre_parse_opt(struct link_util *lu, int argc, char **argv, +@@ -93,6 +102,7 @@ static int gre_parse_opt(struct link_util *lu, int argc, char **argv, + __u16 encapdport = 0; + __u8 metadata = 0; + __u32 fwmark = 0; ++ bool is_erspan = gre_is_erspan(lu); + __u32 erspan_idx = 0; + __u8 erspan_ver = 1; + __u8 erspan_dir = 0; +@@ -334,19 +344,19 @@ get_failed: + NEXT_ARG(); + if (get_u32(&fwmark, *argv, 0)) + invarg("invalid fwmark\n", *argv); +- } else if (strcmp(*argv, "erspan") == 0) { ++ } else if (is_erspan && strcmp(*argv, "erspan") == 0) { + NEXT_ARG(); + if (get_u32(&erspan_idx, *argv, 0)) + invarg("invalid erspan index\n", *argv); + if (erspan_idx & ~((1<<20) - 1) || erspan_idx == 0) + invarg("erspan index must be > 0 and <= 20-bit\n", *argv); +- } else if (strcmp(*argv, "erspan_ver") == 0) { ++ } else if (is_erspan && strcmp(*argv, "erspan_ver") == 0) { + NEXT_ARG(); + if (get_u8(&erspan_ver, *argv, 0)) + invarg("invalid erspan version\n", *argv); + if (erspan_ver != 1 && erspan_ver != 2) + invarg("erspan version must be 1 or 2\n", *argv); +- } else if (strcmp(*argv, "erspan_dir") == 0) { ++ } else if (is_erspan && strcmp(*argv, "erspan_dir") == 0) { + NEXT_ARG(); + if (matches(*argv, "ingress") == 0) + erspan_dir = 0; +@@ -354,7 +364,7 @@ get_failed: + erspan_dir = 1; + else + invarg("Invalid erspan direction.", *argv); +- } else if (strcmp(*argv, "erspan_hwid") == 0) { ++ } else if (is_erspan && strcmp(*argv, "erspan_hwid") == 0) { + NEXT_ARG(); + if (get_u16(&erspan_hwid, *argv, 0)) + invarg("invalid erspan hwid\n", *argv); +@@ -402,7 +412,7 @@ get_failed: + addattr32(n, 1024, IFLA_GRE_LINK, link); + addattr_l(n, 1024, IFLA_GRE_TTL, &ttl, 1); + addattr32(n, 1024, IFLA_GRE_FWMARK, fwmark); +- if (erspan_ver) { ++ if (is_erspan) { + addattr8(n, 1024, IFLA_GRE_ERSPAN_VER, erspan_ver); + if (erspan_ver == 1 && erspan_idx != 0) { + addattr32(n, 1024, IFLA_GRE_ERSPAN_INDEX, erspan_idx); +-- +2.27.0 + diff --git a/0025-tc-fq_codel-fix-class-stat-deficit-is-signed-int.patch b/0025-tc-fq_codel-fix-class-stat-deficit-is-signed-int.patch new file mode 100644 index 0000000..ed2ea15 --- /dev/null +++ b/0025-tc-fq_codel-fix-class-stat-deficit-is-signed-int.patch @@ -0,0 +1,33 @@ +From 67a2a5552508a09f27f4e6206cb91e52fd07ded3 Mon Sep 17 00:00:00 2001 +From: Benjamin Lee +Date: Tue, 14 Apr 2020 21:11:12 -0700 +Subject: [PATCH] tc: fq_codel: fix class stat deficit is signed int + +The fq_codel class stat deficit is a signed int. This is a regression +from when JSON output was added. + +Fixes: 997f2dc19378 ("tc: Add JSON output of fq_codel stats") +Signed-off-by: Benjamin Lee +Signed-off-by: Stephen Hemminger +(cherry picked from commit f03ad792f3cdef5ade92392db6710441b35b47dd) +Signed-off-by: Phil Sutter +--- + tc/q_fq_codel.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tc/q_fq_codel.c b/tc/q_fq_codel.c +index d002940da6b78..009eee42d4af9 100644 +--- a/tc/q_fq_codel.c ++++ b/tc/q_fq_codel.c +@@ -263,7 +263,7 @@ static int fq_codel_print_xstats(struct qdisc_util *qu, FILE *f, + st->qdisc_stats.old_flows_len); + } + if (st->type == TCA_FQ_CODEL_XSTATS_CLASS) { +- print_uint(PRINT_ANY, "deficit", " deficit %u", ++ print_int(PRINT_ANY, "deficit", " deficit %d", + st->class_stats.deficit); + print_uint(PRINT_ANY, "count", " count %u", + st->class_stats.count); +-- +2.27.0 + diff --git a/0026-xfrm-also-check-for-ipv6-state-in-xfrm_state_keep.patch b/0026-xfrm-also-check-for-ipv6-state-in-xfrm_state_keep.patch new file mode 100644 index 0000000..8cdf063 --- /dev/null +++ b/0026-xfrm-also-check-for-ipv6-state-in-xfrm_state_keep.patch @@ -0,0 +1,46 @@ +From 297a05e145a4e7ab14b5391b369825ce0acd0c01 Mon Sep 17 00:00:00 2001 +From: Xin Long +Date: Mon, 27 Apr 2020 15:14:24 +0800 +Subject: [PATCH] xfrm: also check for ipv6 state in xfrm_state_keep + +As commit f9d696cf414c ("xfrm: not try to delete ipcomp states when using +deleteall") does, this patch is to fix the same issue for ip6 state where +xsinfo->id.proto == IPPROTO_IPV6. + + # ip xfrm state add src 2000::1 dst 2000::2 spi 0x1000 \ + proto comp comp deflate mode tunnel sel src 2000::1 dst \ + 2000::2 proto gre + # ip xfrm sta deleteall + Failed to send delete-all request + : Operation not permitted + +Note that the xsinfo->proto in common states can never be IPPROTO_IPV6. + +Fixes: f9d696cf414c ("xfrm: not try to delete ipcomp states when using deleteall") +Reported-by: Xiumei Mu +Signed-off-by: Xin Long +Acked-by: Andrea Claudi +Signed-off-by: Stephen Hemminger +(cherry picked from commit d27fc6390ce32ecdba6324e22b1c341791c5c63f) +Signed-off-by: Phil Sutter +--- + ip/xfrm_state.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/ip/xfrm_state.c b/ip/xfrm_state.c +index d014444e9af4f..44f08ceed24dd 100644 +--- a/ip/xfrm_state.c ++++ b/ip/xfrm_state.c +@@ -1131,7 +1131,8 @@ static int xfrm_state_keep(struct nlmsghdr *n, void *arg) + if (!xfrm_state_filter_match(xsinfo)) + return 0; + +- if (xsinfo->id.proto == IPPROTO_IPIP) ++ if (xsinfo->id.proto == IPPROTO_IPIP || ++ xsinfo->id.proto == IPPROTO_IPV6) + return 0; + + if (xb->offset > xb->size) { +-- +2.27.0 + diff --git a/0027-bridge-Fix-typo.patch b/0027-bridge-Fix-typo.patch new file mode 100644 index 0000000..649173a --- /dev/null +++ b/0027-bridge-Fix-typo.patch @@ -0,0 +1,30 @@ +From ac24381e460e944064f80999ad76f3e4e0528e08 Mon Sep 17 00:00:00 2001 +From: Benjamin Poirier +Date: Fri, 1 May 2020 17:47:16 +0900 +Subject: [PATCH] bridge: Fix typo + +Fixes: 7abf5de677e3 ("bridge: vlan: add support to display per-vlan statistics") +Signed-off-by: Benjamin Poirier +Signed-off-by: Stephen Hemminger +(cherry picked from commit 91b1b49ed3934eb423308130bb3365a0afebf5af) +Signed-off-by: Phil Sutter +--- + bridge/vlan.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/bridge/vlan.c b/bridge/vlan.c +index 205851e4f78ec..24dffa1084014 100644 +--- a/bridge/vlan.c ++++ b/bridge/vlan.c +@@ -546,7 +546,7 @@ static int vlan_show(int argc, char **argv, int subject) + + ret = rtnl_dump_filter(&rth, print_vlan, &subject); + if (ret < 0) { +- fprintf(stderr, "Dump ternminated\n"); ++ fprintf(stderr, "Dump terminated\n"); + exit(1); + } + } else { +-- +2.27.0 + diff --git a/0028-bridge-Fix-output-with-empty-vlan-lists.patch b/0028-bridge-Fix-output-with-empty-vlan-lists.patch new file mode 100644 index 0000000..064c86e --- /dev/null +++ b/0028-bridge-Fix-output-with-empty-vlan-lists.patch @@ -0,0 +1,210 @@ +From 966466bb7b2d54f37516ff4a171fa3e2241b7381 Mon Sep 17 00:00:00 2001 +From: Benjamin Poirier +Date: Fri, 1 May 2020 17:47:17 +0900 +Subject: [PATCH] bridge: Fix output with empty vlan lists + +Consider this configuration: + +ip link add br0 type bridge +ip link add vx0 type vxlan dstport 4789 external +ip link set dev vx0 master br0 +bridge vlan del vid 1 dev vx0 +ip link add vx1 type vxlan dstport 4790 external +ip link set dev vx1 master br0 + + root@vsid:/src/iproute2# ./bridge/bridge vlan + port vlan-id + br0 1 PVID Egress Untagged + + vx0 None + vx1 1 PVID Egress Untagged + + root@vsid:/src/iproute2# + +Note the useless and inconsistent empty lines. + + root@vsid:/src/iproute2# ./bridge/bridge vlan tunnelshow + port vlan-id tunnel-id + br0 + vx0 None + vx1 + +What's the difference between "None" and ""? + + root@vsid:/src/iproute2# ./bridge/bridge -j -p vlan tunnelshow + [ { + "ifname": "br0", + "tunnels": [ ] + },{ + "ifname": "vx1", + "tunnels": [ ] + } ] + +Why does vx0 appear in normal output and not json output? +Why output an empty list for br0 and vx1? + +Fix these inconsistencies and avoid outputting entries with no values. This +makes the behavior consistent with other iproute2 commands, for example +`ip -6 addr`: if an interface doesn't have any ipv6 addresses, it is not +part of the listing. + +Fixes: 8652eeb3ab12 ("bridge: vlan: support for per vlan tunnel info") +Signed-off-by: Benjamin Poirier +Signed-off-by: Stephen Hemminger +(cherry picked from commit b262a9becbcb9d0816b7953fd223dd9a7add8e12) +Signed-off-by: Phil Sutter +--- + bridge/vlan.c | 36 +++++++++++++----------- + testsuite/tests/bridge/vlan/show.t | 30 ++++++++++++++++++++ + testsuite/tests/bridge/vlan/tunnelshow.t | 2 +- + 3 files changed, 50 insertions(+), 18 deletions(-) + create mode 100755 testsuite/tests/bridge/vlan/show.t + +diff --git a/bridge/vlan.c b/bridge/vlan.c +index 24dffa1084014..c1e28ba082b9e 100644 +--- a/bridge/vlan.c ++++ b/bridge/vlan.c +@@ -290,8 +290,7 @@ static void print_vlan_tunnel_info(struct rtattr *tb, int ifindex) + int rem = RTA_PAYLOAD(list); + __u16 last_vid_start = 0; + __u32 last_tunid_start = 0; +- +- open_vlan_port(ifindex, "%s", VLAN_SHOW_TUNNELINFO); ++ bool opened = false; + + for (i = RTA_DATA(list); RTA_OK(i, rem); i = RTA_NEXT(i, rem)) { + struct rtattr *ttb[IFLA_BRIDGE_VLAN_TUNNEL_MAX+1]; +@@ -331,13 +330,20 @@ static void print_vlan_tunnel_info(struct rtattr *tb, int ifindex) + else if (vcheck_ret == 0) + continue; + ++ if (!opened) { ++ open_vlan_port(ifindex, "%s", VLAN_SHOW_TUNNELINFO); ++ opened = true; ++ } ++ + open_json_object(NULL); + print_range("vlan", last_vid_start, tunnel_vid); + print_range("tunid", last_tunid_start, tunnel_id); + close_json_object(); + print_string(PRINT_FP, NULL, "%s", _SL_); + } +- close_vlan_port(); ++ ++ if (opened) ++ close_vlan_port(); + } + + static int print_vlan(struct nlmsghdr *n, void *arg) +@@ -366,16 +372,8 @@ static int print_vlan(struct nlmsghdr *n, void *arg) + return 0; + + parse_rtattr(tb, IFLA_MAX, IFLA_RTA(ifm), len); +- +- /* if AF_SPEC isn't there, vlan table is not preset for this port */ +- if (!tb[IFLA_AF_SPEC]) { +- if (!filter_vlan && !is_json_context()) { +- color_fprintf(stdout, COLOR_IFNAME, "%s", +- ll_index_to_name(ifm->ifi_index)); +- fprintf(stdout, "\tNone\n"); +- } ++ if (!tb[IFLA_AF_SPEC]) + return 0; +- } + + switch (*subject) { + case VLAN_SHOW_VLAN: +@@ -385,9 +383,7 @@ static int print_vlan(struct nlmsghdr *n, void *arg) + print_vlan_tunnel_info(tb[IFLA_AF_SPEC], ifm->ifi_index); + break; + } +- print_string(PRINT_FP, NULL, "%s", _SL_); + +- fflush(stdout); + return 0; + } + +@@ -588,8 +584,7 @@ void print_vlan_info(struct rtattr *tb, int ifindex) + struct rtattr *i, *list = tb; + int rem = RTA_PAYLOAD(list); + __u16 last_vid_start = 0; +- +- open_vlan_port(ifindex, "%s", VLAN_SHOW_VLAN); ++ bool opened = false; + + for (i = RTA_DATA(list); RTA_OK(i, rem); i = RTA_NEXT(i, rem)) { + struct bridge_vlan_info *vinfo; +@@ -608,6 +603,11 @@ void print_vlan_info(struct rtattr *tb, int ifindex) + else if (vcheck_ret == 0) + continue; + ++ if (!opened) { ++ open_vlan_port(ifindex, "%s", VLAN_SHOW_VLAN); ++ opened = true; ++ } ++ + open_json_object(NULL); + print_range("vlan", last_vid_start, vinfo->vid); + +@@ -615,7 +615,9 @@ void print_vlan_info(struct rtattr *tb, int ifindex) + close_json_object(); + print_string(PRINT_FP, NULL, "%s", _SL_); + } +- close_vlan_port(); ++ ++ if (opened) ++ close_vlan_port(); + } + + int do_vlan(int argc, char **argv) +diff --git a/testsuite/tests/bridge/vlan/show.t b/testsuite/tests/bridge/vlan/show.t +new file mode 100755 +index 0000000000000..3def202226a47 +--- /dev/null ++++ b/testsuite/tests/bridge/vlan/show.t +@@ -0,0 +1,30 @@ ++#!/bin/sh ++ ++. lib/generic.sh ++ ++ts_log "[Testing vlan show]" ++ ++BR_DEV="$(rand_dev)" ++VX0_DEV="$(rand_dev)" ++VX1_DEV="$(rand_dev)" ++ ++ts_ip "$0" "Add $BR_DEV bridge interface" link add $BR_DEV type bridge ++ ++ts_ip "$0" "Add $VX0_DEV vxlan interface" \ ++ link add $VX0_DEV type vxlan dstport 4789 external ++ts_ip "$0" "Enslave $VX0_DEV under $BR_DEV" \ ++ link set dev $VX0_DEV master $BR_DEV ++ts_bridge "$0" "Delete default vlan from $VX0_DEV" \ ++ vlan del dev $VX0_DEV vid 1 ++ts_ip "$0" "Add $VX1_DEV vxlan interface" \ ++ link add $VX1_DEV type vxlan dstport 4790 external ++ts_ip "$0" "Enslave $VX1_DEV under $BR_DEV" \ ++ link set dev $VX1_DEV master $BR_DEV ++ ++# Test that bridge ports without vlans do not appear in the output ++ts_bridge "$0" "Show vlan" vlan ++test_on_not "$VX0_DEV" ++ ++# Test that bridge ports without tunnels do not appear in the output ++ts_bridge "$0" "Show vlan tunnel info" vlan tunnelshow ++test_lines_count 1 # header only +diff --git a/testsuite/tests/bridge/vlan/tunnelshow.t b/testsuite/tests/bridge/vlan/tunnelshow.t +index fd41bfcb32a2b..3e9c12a21a9cc 100755 +--- a/testsuite/tests/bridge/vlan/tunnelshow.t ++++ b/testsuite/tests/bridge/vlan/tunnelshow.t +@@ -28,6 +28,6 @@ ts_bridge "$0" "Add tunnel with vni > 16k" \ + + ts_bridge "$0" "Show tunnel info" vlan tunnelshow dev $VX_DEV + test_on "1030\s+65556" +-test_lines_count 5 ++test_lines_count 4 + + ts_bridge "$0" "Dump tunnel info" -j vlan tunnelshow dev $VX_DEV +-- +2.27.0 + diff --git a/0029-tc-action-fix-time-values-output-in-JSON-format.patch b/0029-tc-action-fix-time-values-output-in-JSON-format.patch new file mode 100644 index 0000000..6b5347e --- /dev/null +++ b/0029-tc-action-fix-time-values-output-in-JSON-format.patch @@ -0,0 +1,60 @@ +From 79f92b4d8920686c2ca32431bdb8096bc9921d32 Mon Sep 17 00:00:00 2001 +From: Roman Mashak +Date: Tue, 19 May 2020 20:59:44 -0400 +Subject: [PATCH] tc: action: fix time values output in JSON format + +Report tcf_t values in seconds, not jiffies, in JSON format as it is now +for stdout. + +v2: use PRINT_ANY, drop the useless casts and fix the style (Stephen Hemminger) + +Fixes: 2704bd625583 ("tc: jsonify actions core") +Cc: Jiri Pirko +Signed-off-by: Roman Mashak +Signed-off-by: Stephen Hemminger +(cherry picked from commit db35e411ec17bf9da67f22f995fe1e8d5edcda98) +Signed-off-by: Phil Sutter +--- + tc/tc_util.c | 26 +++++++++++--------------- + 1 file changed, 11 insertions(+), 15 deletions(-) + +diff --git a/tc/tc_util.c b/tc/tc_util.c +index 393721e33bf0e..18cde3ab86df1 100644 +--- a/tc/tc_util.c ++++ b/tc/tc_util.c +@@ -745,21 +745,17 @@ void print_tm(FILE *f, const struct tcf_t *tm) + { + int hz = get_user_hz(); + +- if (tm->install != 0) { +- print_uint(PRINT_JSON, "installed", NULL, tm->install); +- print_uint(PRINT_FP, NULL, " installed %u sec", +- (unsigned int)(tm->install/hz)); +- } +- if (tm->lastuse != 0) { +- print_uint(PRINT_JSON, "last_used", NULL, tm->lastuse); +- print_uint(PRINT_FP, NULL, " used %u sec", +- (unsigned int)(tm->lastuse/hz)); +- } +- if (tm->expires != 0) { +- print_uint(PRINT_JSON, "expires", NULL, tm->expires); +- print_uint(PRINT_FP, NULL, " expires %u sec", +- (unsigned int)(tm->expires/hz)); +- } ++ if (tm->install != 0) ++ print_uint(PRINT_ANY, "installed", " installed %u sec", ++ tm->install / hz); ++ ++ if (tm->lastuse != 0) ++ print_uint(PRINT_ANY, "last_used", " used %u sec", ++ tm->lastuse / hz); ++ ++ if (tm->expires != 0) ++ print_uint(PRINT_ANY, "expires", " expires %u sec", ++ tm->expires / hz); + } + + static void print_tcstats_basic_hw(struct rtattr **tbs, char *prefix) +-- +2.27.0 + diff --git a/0030-Revert-bpf-replace-snprintf-with-asprintf-when-deali.patch b/0030-Revert-bpf-replace-snprintf-with-asprintf-when-deali.patch new file mode 100644 index 0000000..bf25b27 --- /dev/null +++ b/0030-Revert-bpf-replace-snprintf-with-asprintf-when-deali.patch @@ -0,0 +1,337 @@ +From b15ad0affd67e135680c99edc2eb5f178ab2c310 Mon Sep 17 00:00:00 2001 +From: Andrea Claudi +Date: Tue, 26 May 2020 18:04:10 +0200 +Subject: [PATCH] Revert "bpf: replace snprintf with asprintf when dealing with + long buffers" + +This reverts commit c0325b06382cb4f7ebfaf80c29c8800d74666fd9. +It introduces a segfault in bpf_make_custom_path() when custom pinning is used. + +This happens because asprintf allocates exactly the space needed to hold a +string in the buffer passed as its first argument, but if this buffer is later +used in strcat() or similar we have a buffer overrun. + +As the aim of commit c0325b06382c is simply to fix a compiler warning, it +seems safe and reasonable to revert it. + +Fixes: c0325b06382c ("bpf: replace snprintf with asprintf when dealing with long buffers") +Reported-by: Jamal Hadi Salim +Signed-off-by: Andrea Claudi +Signed-off-by: Stephen Hemminger +(cherry picked from commit 358abfe004a30bf3ed353c7f5dbc6afaf4212ecf) +Signed-off-by: Phil Sutter +--- + lib/bpf.c | 155 ++++++++++++++---------------------------------------- + 1 file changed, 39 insertions(+), 116 deletions(-) + +diff --git a/lib/bpf.c b/lib/bpf.c +index 10cf9bf44419a..23cb0d96a85ba 100644 +--- a/lib/bpf.c ++++ b/lib/bpf.c +@@ -406,21 +406,13 @@ static int bpf_derive_elf_map_from_fdinfo(int fd, struct bpf_elf_map *map, + struct bpf_map_ext *ext) + { + unsigned int val, owner_type = 0, owner_jited = 0; +- char *file = NULL; +- char buff[4096]; ++ char file[PATH_MAX], buff[4096]; + FILE *fp; +- int ret; + +- ret = asprintf(&file, "/proc/%d/fdinfo/%d", getpid(), fd); +- if (ret < 0) { +- fprintf(stderr, "asprintf failed: %s\n", strerror(errno)); +- free(file); +- return ret; +- } ++ snprintf(file, sizeof(file), "/proc/%d/fdinfo/%d", getpid(), fd); + memset(map, 0, sizeof(*map)); + + fp = fopen(file, "r"); +- free(file); + if (!fp) { + fprintf(stderr, "No procfs support?!\n"); + return -EIO; +@@ -608,9 +600,8 @@ int bpf_trace_pipe(void) + 0, + }; + int fd_in, fd_out = STDERR_FILENO; +- char *tpipe = NULL; ++ char tpipe[PATH_MAX]; + const char *mnt; +- int ret; + + mnt = bpf_find_mntpt("tracefs", TRACEFS_MAGIC, tracefs_mnt, + sizeof(tracefs_mnt), tracefs_known_mnts); +@@ -619,15 +610,9 @@ int bpf_trace_pipe(void) + return -1; + } + +- ret = asprintf(&tpipe, "%s/trace_pipe", mnt); +- if (ret < 0) { +- fprintf(stderr, "asprintf failed: %s\n", strerror(errno)); +- free(tpipe); +- return ret; +- } ++ snprintf(tpipe, sizeof(tpipe), "%s/trace_pipe", mnt); + + fd_in = open(tpipe, O_RDONLY); +- free(tpipe); + if (fd_in < 0) + return -1; + +@@ -648,50 +633,37 @@ int bpf_trace_pipe(void) + + static int bpf_gen_global(const char *bpf_sub_dir) + { +- char *bpf_glo_dir = NULL; ++ char bpf_glo_dir[PATH_MAX]; + int ret; + +- ret = asprintf(&bpf_glo_dir, "%s/%s/", bpf_sub_dir, BPF_DIR_GLOBALS); +- if (ret < 0) { +- fprintf(stderr, "asprintf failed: %s\n", strerror(errno)); +- goto out; +- } ++ snprintf(bpf_glo_dir, sizeof(bpf_glo_dir), "%s/%s/", ++ bpf_sub_dir, BPF_DIR_GLOBALS); + + ret = mkdir(bpf_glo_dir, S_IRWXU); + if (ret && errno != EEXIST) { + fprintf(stderr, "mkdir %s failed: %s\n", bpf_glo_dir, + strerror(errno)); +- goto out; ++ return ret; + } + +- ret = 0; +-out: +- free(bpf_glo_dir); +- return ret; ++ return 0; + } + + static int bpf_gen_master(const char *base, const char *name) + { +- char *bpf_sub_dir = NULL; ++ char bpf_sub_dir[PATH_MAX + NAME_MAX + 1]; + int ret; + +- ret = asprintf(&bpf_sub_dir, "%s%s/", base, name); +- if (ret < 0) { +- fprintf(stderr, "asprintf failed: %s\n", strerror(errno)); +- goto out; +- } ++ snprintf(bpf_sub_dir, sizeof(bpf_sub_dir), "%s%s/", base, name); + + ret = mkdir(bpf_sub_dir, S_IRWXU); + if (ret && errno != EEXIST) { + fprintf(stderr, "mkdir %s failed: %s\n", bpf_sub_dir, + strerror(errno)); +- goto out; ++ return ret; + } + +- ret = bpf_gen_global(bpf_sub_dir); +-out: +- free(bpf_sub_dir); +- return ret; ++ return bpf_gen_global(bpf_sub_dir); + } + + static int bpf_slave_via_bind_mnt(const char *full_name, +@@ -720,22 +692,13 @@ static int bpf_slave_via_bind_mnt(const char *full_name, + static int bpf_gen_slave(const char *base, const char *name, + const char *link) + { +- char *bpf_lnk_dir = NULL; +- char *bpf_sub_dir = NULL; ++ char bpf_lnk_dir[PATH_MAX + NAME_MAX + 1]; ++ char bpf_sub_dir[PATH_MAX + NAME_MAX]; + struct stat sb = {}; + int ret; + +- ret = asprintf(&bpf_lnk_dir, "%s%s/", base, link); +- if (ret < 0) { +- fprintf(stderr, "asprintf failed: %s\n", strerror(errno)); +- goto out; +- } +- +- ret = asprintf(&bpf_sub_dir, "%s%s", base, name); +- if (ret < 0) { +- fprintf(stderr, "asprintf failed: %s\n", strerror(errno)); +- goto out; +- } ++ snprintf(bpf_lnk_dir, sizeof(bpf_lnk_dir), "%s%s/", base, link); ++ snprintf(bpf_sub_dir, sizeof(bpf_sub_dir), "%s%s", base, name); + + ret = symlink(bpf_lnk_dir, bpf_sub_dir); + if (ret) { +@@ -743,30 +706,25 @@ static int bpf_gen_slave(const char *base, const char *name, + if (errno != EPERM) { + fprintf(stderr, "symlink %s failed: %s\n", + bpf_sub_dir, strerror(errno)); +- goto out; ++ return ret; + } + +- ret = bpf_slave_via_bind_mnt(bpf_sub_dir, bpf_lnk_dir); +- goto out; ++ return bpf_slave_via_bind_mnt(bpf_sub_dir, ++ bpf_lnk_dir); + } + + ret = lstat(bpf_sub_dir, &sb); + if (ret) { + fprintf(stderr, "lstat %s failed: %s\n", + bpf_sub_dir, strerror(errno)); +- goto out; ++ return ret; + } + +- if ((sb.st_mode & S_IFMT) != S_IFLNK) { +- ret = bpf_gen_global(bpf_sub_dir); +- goto out; +- } ++ if ((sb.st_mode & S_IFMT) != S_IFLNK) ++ return bpf_gen_global(bpf_sub_dir); + } + +-out: +- free(bpf_lnk_dir); +- free(bpf_sub_dir); +- return ret; ++ return 0; + } + + static int bpf_gen_hierarchy(const char *base) +@@ -784,7 +742,7 @@ static int bpf_gen_hierarchy(const char *base) + static const char *bpf_get_work_dir(enum bpf_prog_type type) + { + static char bpf_tmp[PATH_MAX] = BPF_DIR_MNT; +- static char *bpf_wrk_dir; ++ static char bpf_wrk_dir[PATH_MAX]; + static const char *mnt; + static bool bpf_mnt_cached; + const char *mnt_env = getenv(BPF_ENV_MNT); +@@ -823,12 +781,7 @@ static const char *bpf_get_work_dir(enum bpf_prog_type type) + } + } + +- ret = asprintf(&bpf_wrk_dir, "%s/", mnt); +- if (ret < 0) { +- fprintf(stderr, "asprintf failed: %s\n", strerror(errno)); +- free(bpf_wrk_dir); +- goto out; +- } ++ snprintf(bpf_wrk_dir, sizeof(bpf_wrk_dir), "%s/", mnt); + + ret = bpf_gen_hierarchy(bpf_wrk_dir); + if (ret) { +@@ -1485,48 +1438,31 @@ static int bpf_probe_pinned(const char *name, const struct bpf_elf_ctx *ctx, + + static int bpf_make_obj_path(const struct bpf_elf_ctx *ctx) + { +- char *tmp = NULL; ++ char tmp[PATH_MAX]; + int ret; + +- ret = asprintf(&tmp, "%s/%s", bpf_get_work_dir(ctx->type), ctx->obj_uid); +- if (ret < 0) { +- fprintf(stderr, "asprintf failed: %s\n", strerror(errno)); +- goto out; +- } ++ snprintf(tmp, sizeof(tmp), "%s/%s", bpf_get_work_dir(ctx->type), ++ ctx->obj_uid); + + ret = mkdir(tmp, S_IRWXU); + if (ret && errno != EEXIST) { + fprintf(stderr, "mkdir %s failed: %s\n", tmp, strerror(errno)); +- goto out; ++ return ret; + } + +- ret = 0; +-out: +- free(tmp); +- return ret; ++ return 0; + } + + static int bpf_make_custom_path(const struct bpf_elf_ctx *ctx, + const char *todo) + { +- char *tmp = NULL; +- char *rem = NULL; +- char *sub; ++ char tmp[PATH_MAX], rem[PATH_MAX], *sub; + int ret; + +- ret = asprintf(&tmp, "%s/../", bpf_get_work_dir(ctx->type)); +- if (ret < 0) { +- fprintf(stderr, "asprintf failed: %s\n", strerror(errno)); +- goto out; +- } +- +- ret = asprintf(&rem, "%s/", todo); +- if (ret < 0) { +- fprintf(stderr, "asprintf failed: %s\n", strerror(errno)); +- goto out; +- } +- ++ snprintf(tmp, sizeof(tmp), "%s/../", bpf_get_work_dir(ctx->type)); ++ snprintf(rem, sizeof(rem), "%s/", todo); + sub = strtok(rem, "/"); ++ + while (sub) { + if (strlen(tmp) + strlen(sub) + 2 > PATH_MAX) + return -EINVAL; +@@ -1538,17 +1474,13 @@ static int bpf_make_custom_path(const struct bpf_elf_ctx *ctx, + if (ret && errno != EEXIST) { + fprintf(stderr, "mkdir %s failed: %s\n", tmp, + strerror(errno)); +- goto out; ++ return ret; + } + + sub = strtok(NULL, "/"); + } + +- ret = 0; +-out: +- free(rem); +- free(tmp); +- return ret; ++ return 0; + } + + static int bpf_place_pinned(int fd, const char *name, +@@ -2655,23 +2587,14 @@ struct bpf_jited_aux { + + static int bpf_derive_prog_from_fdinfo(int fd, struct bpf_prog_data *prog) + { +- char *file = NULL; +- char buff[4096]; ++ char file[PATH_MAX], buff[4096]; + unsigned int val; + FILE *fp; +- int ret; +- +- ret = asprintf(&file, "/proc/%d/fdinfo/%d", getpid(), fd); +- if (ret < 0) { +- fprintf(stderr, "asprintf failed: %s\n", strerror(errno)); +- free(file); +- return ret; +- } + ++ snprintf(file, sizeof(file), "/proc/%d/fdinfo/%d", getpid(), fd); + memset(prog, 0, sizeof(*prog)); + + fp = fopen(file, "r"); +- free(file); + if (!fp) { + fprintf(stderr, "No procfs support?!\n"); + return -EIO; +-- +2.27.0 + diff --git a/0031-bpf-Fixes-a-snprintf-truncation-warning.patch b/0031-bpf-Fixes-a-snprintf-truncation-warning.patch new file mode 100644 index 0000000..2a0a40d --- /dev/null +++ b/0031-bpf-Fixes-a-snprintf-truncation-warning.patch @@ -0,0 +1,49 @@ +From 69986423a0df3a5613697b37a2f1fb6c6fd100c0 Mon Sep 17 00:00:00 2001 +From: Andrea Claudi +Date: Tue, 26 May 2020 18:04:11 +0200 +Subject: [PATCH] bpf: Fixes a snprintf truncation warning +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +gcc v9.3.1 reports: + +bpf.c: In function ‘bpf_get_work_dir’: +bpf.c:784:49: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=] + 784 | snprintf(bpf_wrk_dir, sizeof(bpf_wrk_dir), "%s/", mnt); + | ^ +bpf.c:784:2: note: ‘snprintf’ output between 2 and 4097 bytes into a destination of size 4096 + 784 | snprintf(bpf_wrk_dir, sizeof(bpf_wrk_dir), "%s/", mnt); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Fix this simply checking snprintf return code and properly handling the error. + +Fixes: e42256699cac ("bpf: make tc's bpf loader generic and move into lib") +Signed-off-by: Andrea Claudi +Signed-off-by: Stephen Hemminger +(cherry picked from commit 354efaec3895f004382414f2df17e7d820e695f6) +Signed-off-by: Phil Sutter +--- + lib/bpf.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/lib/bpf.c b/lib/bpf.c +index 23cb0d96a85ba..c7d45077c14e5 100644 +--- a/lib/bpf.c ++++ b/lib/bpf.c +@@ -781,7 +781,11 @@ static const char *bpf_get_work_dir(enum bpf_prog_type type) + } + } + +- snprintf(bpf_wrk_dir, sizeof(bpf_wrk_dir), "%s/", mnt); ++ ret = snprintf(bpf_wrk_dir, sizeof(bpf_wrk_dir), "%s/", mnt); ++ if (ret < 0 || ret >= sizeof(bpf_wrk_dir)) { ++ mnt = NULL; ++ goto out; ++ } + + ret = bpf_gen_hierarchy(bpf_wrk_dir); + if (ret) { +-- +2.27.0 + diff --git a/0032-ss-fix-end-of-line-printing-in-misc-ss.c.patch b/0032-ss-fix-end-of-line-printing-in-misc-ss.c.patch new file mode 100644 index 0000000..776bfbd --- /dev/null +++ b/0032-ss-fix-end-of-line-printing-in-misc-ss.c.patch @@ -0,0 +1,41 @@ +From f2b6f619af8ebc693c7b0c0abc52b6943800ffe9 Mon Sep 17 00:00:00 2001 +From: Brian Vazquez +Date: Wed, 4 Dec 2019 13:32:28 -0800 +Subject: [PATCH] ss: fix end-of-line printing in misc/ss.c + +The previous change to ss to show header broke the printing of +end-of-line for the last entry. + +Tested: + +diff <(./ss.old -nltp) <(misc/ss -nltp) +38c38 +< LISTEN 0 128 [::1]:35417 [::]:* users:(("foo",pid=65254,fd=116)) +\ No newline at end of file + +Signed-off-by: Stephen Hemminger +(cherry picked from commit 9eee92a41ae630b2c9e92ae2875ca56801c96b73) +Signed-off-by: Phil Sutter +--- + misc/ss.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/misc/ss.c b/misc/ss.c +index 794c1895c078e..bd55977ef8592 100644 +--- a/misc/ss.c ++++ b/misc/ss.c +@@ -1289,6 +1289,11 @@ static void render(void) + + token = buf_token_next(token); + } ++ /* Deal with final end-of-line when the last non-empty field printed ++ * is not the last field. ++ */ ++ if (line_started) ++ printf("\n"); + + buf_free_all(); + current_field = columns; +-- +2.27.0 + diff --git a/README.etc b/README.etc deleted file mode 100644 index 6fc09c3..0000000 --- a/README.etc +++ /dev/null @@ -1,16 +0,0 @@ -You are looking for your iproute2 config in /etc/iproute2 and it's gone? - -Here's an explanation on what's going on: - -From v6.5.0, iproute2 supports stateless configuration pattern. This -means that iproute2 now read its config from /etc/iproute2/FOO, and, -if it does not exist, fall back to /usr/share/iproute2/FOO. - -You can find iproute2 default configuration in /usr/share/iproute2, -while you can store your user-modified config files in /etc/iproute2. - -/usr/share/iproute2 files are not supposed to be manually modified. - -If a previous update broke your user config for iproute2, you may -have one or more ".rpmsave" files in /etc/iproute2. You can restore -your config simply dropping the ".rpmsave" suffix from the file name. diff --git a/iproute.spec b/iproute.spec index 77088b9..fd31fa8 100644 --- a/iproute.spec +++ b/iproute.spec @@ -1,42 +1,64 @@ +%global cbq_version v0.7.3 Summary: Advanced IP routing and network device configuration tools Name: iproute -Version: 6.17.0 -Release: %autorelease -URL: https://kernel.org/pub/linux/utils/net/%{name}2/ -Source0: https://kernel.org/pub/linux/utils/net/%{name}2/%{name}2-%{version}.tar.xz -%if 0%{?rhel} -Source1: rt_dsfield.deprecated -%endif -Source2: README.etc +Version: 5.4.0 +Release: 2%{?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 -License: GPL-2.0-or-later AND NIST-PD +Patch1: 0001-devlink-allow-full-range-of-resource-sizes.patch +Patch2: 0002-tc-fix-warning-in-tc-m_ct.c.patch +Patch3: 0003-tc-fix-warning-in-tc-q_pie.c.patch +Patch4: 0004-json_print-Remove-declaration-without-implementation.patch +Patch5: 0005-testsuite-Fix-line-count-test.patch +Patch6: 0006-bridge-Fix-typo-in-error-messages.patch +Patch7: 0007-bridge-Fix-src_vni-argument-in-man-page.patch +Patch8: 0008-bridge-Fix-BRIDGE_VLAN_TUNNEL-attribute-sizes.patch +Patch9: 0009-bridge-Fix-vni-printing.patch +Patch10: 0010-bridge-Deduplicate-vlan-show-functions.patch +Patch11: 0011-bridge-Fix-tunnelshow-json-output.patch +Patch12: 0012-devlink-Print-health-reporter-s-dump-time-stamp-in-a.patch +Patch13: 0013-devlink-Add-a-new-time-stamp-format-for-health-repor.patch +Patch14: 0014-devlink-Fix-fmsg-nesting-in-non-JSON-output.patch +Patch15: 0015-ip-xfrm-if_id-ve-value-is-error.patch +Patch16: 0016-tc-fq_codel-fix-missing-statistic-in-JSON-output.patch +Patch17: 0017-ip-fix-link-type-and-vlan-oneline-output.patch +Patch18: 0018-ip-xfrm-Fix-help-messages.patch +Patch19: 0019-ip-link-xstats-fix-TX-IGMP-reports-string.patch +Patch20: 0020-devlink-fix-warning-from-unchecked-write.patch +Patch21: 0021-erspan-set-erspan_ver-to-1-by-default.patch +Patch22: 0022-xfrm-not-try-to-delete-ipcomp-states-when-using-dele.patch +Patch23: 0023-nexthop-fix-error-reporting-in-filter-dump.patch +Patch24: 0024-ip-link_gre-Do-not-send-ERSPAN-attributes-to-GRE-tun.patch +Patch25: 0025-tc-fq_codel-fix-class-stat-deficit-is-signed-int.patch +Patch26: 0026-xfrm-also-check-for-ipv6-state-in-xfrm_state_keep.patch +Patch27: 0027-bridge-Fix-typo.patch +Patch28: 0028-bridge-Fix-output-with-empty-vlan-lists.patch +Patch29: 0029-tc-action-fix-time-values-output-in-JSON-format.patch +Patch30: 0030-Revert-bpf-replace-snprintf-with-asprintf-when-deali.patch +Patch31: 0031-bpf-Fixes-a-snprintf-truncation-warning.patch +Patch32: 0032-ss-fix-end-of-line-printing-in-misc-ss.c.patch + +License: GPLv2+ and Public Domain +BuildRequires: gcc BuildRequires: bison BuildRequires: elfutils-libelf-devel BuildRequires: flex -BuildRequires: gcc BuildRequires: iptables-devel >= 1.4.5 -BuildRequires: libbpf-devel BuildRequires: libcap-devel +BuildRequires: libdb-devel BuildRequires: libmnl-devel BuildRequires: libselinux-devel -BuildRequires: make BuildRequires: pkgconfig %if ! 0%{?_module_build} %if 0%{?fedora} BuildRequires: linux-atm-libs-devel %endif %endif -Requires: libbpf -Requires: psmisc - -# Compat symlinks for Requires in other packages. Provides: /sbin/ip -%if "%{_sbindir}" == "%{_bindir}" -# We rely on filesystem to create the symlink for us. -Requires: filesystem(unmerged-sbin-symlinks) -Provides: /usr/sbin/ip -Provides: /usr/sbin/ss -%endif +Recommends: %{name}-tc +Requires: psmisc +Obsoletes: iproute-doc < %{version}-%{release} %description The iproute package contains networking utilities (ip and rtmon, for example) @@ -45,29 +67,18 @@ kernel. %package tc Summary: Linux Traffic Control utility -License: GPL-2.0-or-later +License: GPLv2+ Requires: %{name}%{?_isa} = %{version}-%{release} -Provides: /sbin/tc +Provides: tc %description tc 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 -License: GPL-2.0-or-later -Requires: %{name} = %{version}-%{release} - -%description doc -The iproute documentation contains howtos and examples of settings. -%endif - %package devel Summary: iproute development files -License: GPL-2.0-or-later -Requires: %{name} = %{version}-%{release} +License: GPLv2+ Provides: iproute-static = %{version}-%{release} %description devel @@ -77,77 +88,51 @@ The libnetlink static library. %autosetup -p1 -n %{name}2-%{version} %build -%configure --color auto -echo -e "\nPREFIX=%{_prefix}\nSBINDIR=%{_sbindir}" >> config.mk -%make_build +export CFLAGS='%{optflags}' +export LDFLAGS='%{build_ldflags}' +export LIBDIR='%{_libdir}' +export IPT_LIB_DIR='/%{_lib}/xtables' +./configure +make %{?_smp_mflags} %install -%make_install - -echo '.so man8/tc-cbq.8' > %{buildroot}%{_mandir}/man8/cbq.8 +export DESTDIR='%{buildroot}' +export SBINDIR='%{_sbindir}' +export MANDIR='%{_mandir}' +export LIBDIR='%{_libdir}' +export CONFDIR='%{_sysconfdir}/iproute2' +export DOCDIR='%{_docdir}' +make install # 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}' - -mkdir -p %{buildroot}%{_sysconfdir}/iproute2 -cp %{SOURCE2} %{buildroot}%{_sysconfdir}/iproute2/README - -# append deprecated values to rt_dsfield for compatibility reasons -%if 0%{?rhel} -cat %{SOURCE1} >>%{buildroot}%{_datadir}/iproute2/rt_dsfield -cp %{SOURCE2} %{buildroot}%{_datadir}/iproute2/README - -# RHEL-94662: restore /etc/iproute2 conf files, if modified -# this is safe because we don't have conf files in /etc/iproute2 anymore, so -# every *.rpmsave file over there is a leftover from a failed conf upgrade - -%posttrans -if [ -f /etc/iproute2/*rpmsave ]; then - for conffile in /etc/iproute2/*rpmsave; do - mv $conffile ${conffile%.rpmsave} - done -fi -%endif - %files %dir %{_sysconfdir}/iproute2 -%dir %{_datadir}/iproute2 +%{!?_licensedir:%global license %%doc} %license COPYING -%doc README README.devel +%doc README %{_mandir}/man7/* %exclude %{_mandir}/man7/tc-* %{_mandir}/man8/* %exclude %{_mandir}/man8/tc* -%exclude %{_mandir}/man8/cbq* -%exclude %{_mandir}/man8/arpd* -%attr(644,root,root) %config %{_datadir}/iproute2/* +%attr(644,root,root) %config(noreplace) %{_sysconfdir}/iproute2/* %{_sbindir}/* -%attr(644,root,root) %{_sysconfdir}/iproute2/* %exclude %{_sbindir}/tc -%exclude %{_sbindir}/routel -%{_datadir}/bash-completion/completions/devlink %files tc +%{!?_licensedir:%global license %%doc} %license COPYING %{_mandir}/man7/tc-* %{_mandir}/man8/tc* -%{_mandir}/man8/cbq* %dir %{_libdir}/tc/ %{_libdir}/tc/* %{_sbindir}/tc %{_datadir}/bash-completion/completions/tc -%if ! 0%{?_module_build} -%files doc -%license COPYING -%doc examples -%endif - %files devel +%{!?_licensedir:%global license %%doc} %license COPYING %{_mandir}/man3/* %{_libdir}/libnetlink.a @@ -155,4 +140,806 @@ fi %{_includedir}/iproute2/bpf_elf.h %changelog -%autochangelog +* Thu Aug 20 22:26:17 GMT 2020 Phil Sutter - 5.4.0-2 +- Add further upstream-suggested backports +- Fix for missing newline in last line of ss output + +* Tue Jan 28 2020 Phil Sutter - 5.4.0-1 +- Rebase package on top of iproute2-5.4.0 +- Add psmisc dependency, ifcfg script uses killall +- Drop iproute-doc package, upstream removed all non-manpage documentation + +* Thu Sep 26 2019 Phil Sutter - 5.3.0-1 +- New version 5.3.0 +- Add upstream-suggested backports + +* Thu Jul 25 2019 Fedora Release Engineering - 5.2.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Tue Jul 23 2019 Phil Sutter - 5.2.0-1 +- New version 5.2.0 +- Add upstream-suggested backports +- Fix for tunnel creation when using 'dev' parameter + +* Wed May 29 2019 Phil Sutter - 5.1.0-1 +- New version 5.1.0 + +* Wed Mar 20 2019 Phil Sutter - 5.0.0-2 +- Restore Provides: hint, at least pptp depends on it + +* Wed Mar 20 2019 Phil Sutter - 5.0.0-1 +- New version 5.0.0 +- Get rid of old upgrade path hints + +* 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 + +* Wed Sep 19 2018 Phil Sutter - 4.18.0-5 +- man: ip-route: Clarify referenced versions are Linux ones + +* Fri Aug 31 2018 Phil Sutter - 4.18.0-4 +- iprule: Fix destination prefix output + +* Thu Aug 23 2018 Phil Sutter - 4.18.0-3 +- Make colored output configurable + +* Thu Aug 16 2018 Phil Sutter - 4.18.0-2 +- Fix ss filter expressions + +* Tue Aug 14 2018 Phil Sutter - 4.18.0-1 +- New version 4.18.0 + +* Fri Jul 13 2018 Fedora Release Engineering - 4.17.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue Jun 12 2018 Phil Sutter - 4.17.0-1 +- New version 4.17.0 + +* Fri Jun 01 2018 Phil Sutter - 4.16.0-1 +- New version 4.16.0 + +* Fri Feb 09 2018 Phil Sutter - 4.15.0-1 +- New version 4.15.0 + +* Fri Feb 9 2018 Florian Weimer - 4.14.1-6 +- Use LDFLAGS defaults from redhat-rpm-config + +* Wed Feb 07 2018 Fedora Release Engineering - 4.14.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* 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. + +* Wed Nov 15 2017 Phil Sutter - 4.14.1-2 +- Drop unused build dependencies + +* Wed Nov 15 2017 Phil Sutter - 4.14.1-1 +- New version 4.14.1 + +* Tue Sep 19 2017 Phil Sutter - 4.13.0-1 +- New version 4.13.0 + +* Wed Aug 02 2017 Fedora Release Engineering - 4.12.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 4.12.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Jul 21 2017 Phil Sutter - 4.12.0-1 +- New version 4.12.0 + +* Tue May 23 2017 Phil Sutter - 4.11.0-1 +- Add virtual capability to tc subpackage so it's easier found +- New version 4.11.0 + +* 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. + +* 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 + +* Thu Feb 2 2017 Thomas Woerner - 4.9.0-3 +- Release bump for iptables-1.6.1 (libxtables.so.12) + +* Sat Jan 28 2017 Phil Sutter - 4.9.0-2 +- Fix for failing 'make install' + +* Sat Jan 28 2017 Phil Sutter - 4.9.0-1 +- New version 4.9.0 + +* Fri Jan 13 2017 Phil Sutter - 4.8.0-2 +- Fix segfault in xt action + +* Wed Nov 30 2016 Phil Sutter - 4.8.0-1 +- New version 4.8.0 + +* Wed Aug 10 2016 Phil Sutter - 4.7.0-1 +- New version 4.7.0 + +* Wed May 04 2016 Phil Sutter - 4.6.0-1 +- New version 4.6.0 + +* Wed Apr 13 2016 Thomas Woerner - 4.5.0-4 +- Rebuild for new iptables-1.6.0 with libxtables so bump + +* Fri Apr 08 2016 Phil Sutter - 4.5.0-3 +- Fix upgrade path by adding correct Requires/Obsoletes statements to spec file +- Move README.iproute2+tc into tc subpackage + +* Fri Mar 18 2016 Phil Sutter - 4.5.0-2 +- Split tc into it's own subpackage + +* Fri Mar 18 2016 Phil Sutter - 4.5.0-1 +- New version 4.5.0 + +* Thu Feb 04 2016 Fedora Release Engineering - 4.4.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Tue Jan 19 2016 Phil Sutter - 4.4.0-1 +- New version 4.4.0 + +* Sun Oct 04 2015 Phil Sutter - 4.2.0-4 +- Simplify RPM install stage by using package's install target + +* Sun Oct 04 2015 Phil Sutter - 4.2.0-3 +- Add missing build dependency to libmnl-devel +- Ship tipc utility + +* Thu Sep 24 2015 Phil Sutter - 4.2.0-2 +- Add missing build dependency to libselinux-devel + +* Wed Sep 02 2015 Pavel Šimerda - 4.2.0-1 +- new version 4.2.0 + +* Tue Jul 07 2015 Pavel Šimerda - 4.1.1-1 +- new version 4.1.1 + +* Wed Jun 17 2015 Fedora Release Engineering - 4.0.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Wed May 13 2015 Pavel Šimerda - 4.0.0-3 +- remove patch rejected by upstream + +* Mon May 11 2015 Pavel Šimerda - 4.0.0-2 +- Remove patch rejected by upstream + +* Tue Apr 14 2015 Pavel Šimerda - 4.0.0-1 +- new version 4.0.0 + +* Fri Mar 13 2015 Pavel Šimerda - 3.19.0-1 +- new version 3.19.0 + +* Sat Oct 04 2014 Lubomir Rintel - 3.16.0-3 +- Backport fix for ip link add name regression that broke libvirt + +* Sat Aug 16 2014 Fedora Release Engineering - 3.16.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Tue Aug 05 2014 Petr Šabata - 3.16.0-1 +- 3.16 bump + +* Sat Jul 12 2014 Tom Callaway - 3.15.0-2 +- fix license handling + +* Thu Jun 12 2014 Petr Šabata - 3.15.0-1 +- 3.15.0 bump + +* Sat Jun 07 2014 Fedora Release Engineering - 3.14.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Tue May 06 2014 Petr Šabata - 3.14.0-2 +- Fix incorrect references in ss(8), #1092653 + +* Tue Apr 15 2014 Petr Šabata - 3.14.0-1 +- 3.14 bump +- Drop out iplink_have_newlink() fix in favor of upstream's approach + +* Tue Nov 26 2013 Petr Šabata - 3.12.0-2 +- Drop libnl from dependencies (#1034454) + +* Mon Nov 25 2013 Petr Šabata - 3.12.0-1 +- 3.12.0 bump + +* Thu Nov 21 2013 Petr Šabata - 3.11.0-2 +- Fix the rtt time parsing again + +* Tue Oct 22 2013 Petr Šabata - 3.11.0-1 +- 3.11 bump + +* Tue Oct 01 2013 Petr Pisar - 3.10.0-8 +- Close file with bridge monitor file (bug #1011822) + +* Tue Sep 24 2013 Petr Pisar - 3.10.0-7 +- Add tc -OK option +- Document "bridge mdb" and "bridge monitor mdb" + +* Fri Aug 30 2013 Petr Šabata - 3.10.0-6 +- Fix lnstat -i properly this time + +* Thu Aug 29 2013 Petr Šabata - 3.10.0-5 +- Fix an 'ip link' hang (#996537) + +* Tue Aug 13 2013 Petr Šabata - 3.10.0-4 +- lnstat -i: Run indefinitely if the --count isn't specified (#977845) +- Switch to unversioned %%docdir + +* Sat Aug 03 2013 Fedora Release Engineering - 3.10.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Wed Jul 17 2013 Petr Šabata - 3.10.0-2 +- Fix the XFRM patch + +* Wed Jul 17 2013 Petr Šabata - 3.10.0-1 +- 3.10.0 bump +- Drop the SHAREDIR patch and revert to upstream ways (#966445) +- Fix an XFRM regression with FORTIFY_SOURCE + +* Tue Apr 30 2013 Petr Šabata - 3.9.0-1 +- 3.9.0 bump + +* Thu Apr 25 2013 Petr Šabata - 3.8.0-4 +- ATM is available in Fedora only + +* Tue Mar 12 2013 Petr Šabata - 3.8.0-3 +- Mention the "up" argument in documentation and help outputs (#907468) + +* Mon Mar 04 2013 Petr Šabata - 3.8.0-2 +- Bump for 1.4.18 rebuild + +* Tue Feb 26 2013 Petr Šabata - 3.8.0-1 +- 3.8.0 bump + +* Fri Feb 08 2013 Petr Šabata - 3.7.0-2 +- Don't propogate mounts out of ip (#882047) + +* Wed Dec 12 2012 Petr Šabata - 3.7.0-1 +- 3.7.0 bump + +* Mon Nov 19 2012 Petr Šabata - 3.6.0-3 +- Include section 7 manpages (#876857) +- Fix ancient bogus dates in the changelog (correction based upon commits) +- Explicitly require some TeX fonts no longer present in the base distribution + +* Thu Oct 04 2012 Petr Šabata - 3.6.0-2 +- List all interfaces by default + +* Wed Oct 03 2012 Petr Šabata - 3.6.0-1 +- 3.6.0 bump + +* Thu Aug 30 2012 Petr Šabata - 3.5.1-2 +- Remove the explicit iptables dependency (#852840) + +* Tue Aug 14 2012 Petr Šabata - 3.5.1-1 +- 3.5.1 bugfix release bump +- Rename 'br' to 'bridge' + +* Mon Aug 06 2012 Petr Šabata - 3.5.0-2 +- Install the new bridge utility + +* Thu Aug 02 2012 Petr Šabata - 3.5.0-1 +- 3.5.0 bump +- Move to db5. + +* Thu Jul 19 2012 Fedora Release Engineering - 3.4.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue May 22 2012 Petr Šabata - 3.4.0-1 +- 3.4.0 bump +- Drop the print route patch (included upstream) + +* Mon Apr 30 2012 Petr Šabata - 3.3.0-2 +- Let's install rtmon too... (#814819) + +* Thu Mar 22 2012 Petr Šabata - 3.3.0-1 +- 3.3.0 bump +- Update source URL + +* Mon Feb 27 2012 Petr Šabata - 3.2.0-3 +- Address dangerous /tmp files security issue (CVE-2012-1088, #797881, #797878) + +* Fri Jan 27 2012 Petr Šabata - 3.2.0-2 +- Simplify the spec a bit thanks to the UsrMove feature + +* Fri Jan 06 2012 Petr Šabata - 3.2.0-1 +- 3.2.0 bump +- Removing a useless, now conflicting patch (initcwnd already decumented) + +* Thu Nov 24 2011 Petr Šabata - 3.1.0-1 +- 3.1.0 bump +- Point URL and Source to the new location on kernel.org +- Remove now obsolete defattr +- Dropping various patches now included upstream +- Dropping iproute2-2.6.25-segfault.patch; I fail to understand the reason for + this hack + +* Tue Nov 15 2011 Petr Šabata - 2.6.39-6 +- ss -ul should display UDP CLOSED sockets (#691100) + +* Thu Oct 06 2011 Petr Sabata - 2.6.39-5 +- Fix ss, lnstat and arpd usage and manpages + +* Wed Sep 07 2011 Petr Sabata - 2.6.39-4 +- lnstat should dump (-d) to stdout instead of stderr (#736332) + +* Tue Jul 26 2011 Petr Sabata - 2.6.39-3 +- Rebuild for xtables7 + +* Tue Jul 12 2011 Petr Sabata - 2.6.39-2 +- Rebuild for xtables6 + +* Thu Jun 30 2011 Petr Sabata - 2.6.39-1 +- 2.6.39 bump + +* Wed Apr 27 2011 Petr Sabata - 2.6.38.1-4 +- Link [cr]tstat to lnstat + +* Wed Apr 27 2011 Petr Sabata - 2.6.38.1-3 +- Install ctstat, rtstat and routef manpage symlinks +- Install m_xt & m_ipt tc modules +- Creating devel and virtual static subpackages with libnetlink + +* Thu Apr 21 2011 Petr Sabata - 2.6.38.1-2 +- General cleanup +- Use global instead of define +- Buildroot removal +- Correcting URL and Source links +- Install genl, ifstat, routef, routel and rtpr (rhbz#697319) + +* Fri Mar 18 2011 Petr Sabata - 2.6.38.1-1 +- 2.6.38.1 bump + +* Wed Mar 16 2011 Petr Sabata - 2.6.38-1 +- 2.6.38 bump + +* Wed Feb 09 2011 Fedora Release Engineering - 2.6.37-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Mon Jan 31 2011 Petr Sabata - 2.6.37-2 +- man-pages.patch update, ip(8) TYPE whitespace + +* Mon Jan 10 2011 Petr Sabata - 2.6.37-1 +- 2.6.37 upstream release +- ss(8) improvements patch removed (included upstream) + +* Wed Dec 08 2010 Petr Sabata - 2.6.35-10 +- fix a typo in ss(8) improvements patch, rhbz#661267 + +* Tue Nov 30 2010 Petr Sabata - 2.6.35-9 +- ss(8) improvements patch by jpopelka; should be included in 2.6.36 + +* Tue Nov 09 2010 Petr Sabata - 2.6.35-8 +- rhbz#641599, use the versioned path, man-pages.patch update, prep update + +* Tue Oct 12 2010 Petr Sabata - 2.6.35-7 +- Do not segfault if peer name is omitted when creating a peer veth link, rhbz#642322 + +* Mon Oct 11 2010 Petr Sabata - 2.6.35-6 +- Man-pages update, rhbz#641599 + +* Wed Sep 29 2010 jkeating - 2.6.35-5 +- Rebuilt for gcc bug 634757 + +* Tue Sep 21 2010 Petr Sabata - 2.6.35-4 +- Modified man-pages.patch to fix cbq manpage, rhbz#635877 + +* Tue Sep 21 2010 Petr Sabata - 2.6.35-3 +- Don't print routes with negative metric fix, rhbz#628739 + +* Wed Aug 18 2010 Petr Sabata - 2.6.35-2 +- 'ip route get' fix, iproute2-2.6.35-print-route.patch +- rhbz#622782 + +* Thu Aug 05 2010 Petr Sabata - 2.6.35-1 +- 2.6.35 version bump +- iproute2-tc-priority.patch removed (included in upstream now) + +* Thu Jul 08 2010 Petr Sabata - 2.6.34-5 +- Licensing guidelines compliance fix + +* Wed Jul 07 2010 Petr Sabata - 2.6.34-4 +- Requires: iptables >= 1.4.5, BuildRequires: iptables-devel >= 1.4.5 + +* Thu Jul 01 2010 Petr Sabata - 2.6.34-3 +- Build now runs ./configure to regenerate Makefile for ipt/xt detection + +* Mon Jun 21 2010 Petr Sabata - 2.6.34-2 +- iproute-tc-priority.patch, rhbz#586112 + +* Mon Jun 21 2010 Petr Sabata - 2.6.34-1 +- 2.6.34 version bump + +* Tue Apr 20 2010 Marcela Mašláňová - 2.6.33-2 +- 578729 6rd tunnel correctly 3979ef91de9ed17d21672aaaefd6c228485135a2 +- change BR texlive to tex according to guidelines + +* Thu Feb 25 2010 Marcela Mašláňová - 2.6.33-1 +- update + +* Tue Jan 26 2010 Marcela Mašláňová - 2.6.32-2 +- add macvlan aka VESA support d63a9b2b1e4e3eab0d0577d0a0f412d50be1e0a7 +- kernel headers 2.6.33 ab322673298bd0b8927cdd9d11f3d36af5941b93 + are needed for macvlan features and probably for other added later. +- fix number of release which contains 2.6.32 kernel headers and features + but it was released as 2.6.31 + +* Mon Jan 4 2010 Marcela Mašláňová - 2.6.31-1 +- update to 2.6.31 + +* Fri Nov 27 2009 Marcela Mašláňová - 2.6.29-5.1.20091106gita7a9ddbb +- 539232 patch cbq initscript + +* Fri Nov 27 2009 Marcela Mašláňová - 2.6.29-5.0.20091106gita7a9ddbb +- snapshot with kernel headers for 2.6.32 + +* Fri Oct 9 2009 Marcela Mašláňová - 2.6.29-5.0.20091009gitdaf49fd6 +- new official version isn't available but it's needed -> switch to git snapshots + +* Thu Sep 24 2009 Marcela Mašláňová - 2.6.29-5 +- create missing man pages + +* Fri Jul 24 2009 Fedora Release Engineering - 2.6.29-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Thu Apr 23 2009 Marcela Mašláňová - 2.6.29-3 +- new iptables (xtables) bring problems to tc, when ipt is used. + rhbz#497344 still broken. tc_modules.patch brings correct paths to + xtables, but that doesn't fix whole issue. +- 497355 ip should allow creation of an IPsec SA with 'proto any' + and specified sport and dport as selectors + +* Tue Apr 14 2009 Marcela Mašláňová - 2.6.29-2 +- c3651bf4763d7247e3edd4e20526a85de459041b ip6tunnel: Fix no default + display of ip4ip6 tunnels +- e48f73d6a5e90d2f883e15ccedf4f53d26bb6e74 missing arpd directory + +* Wed Mar 25 2009 Marcela Mašláňová - 2.6.29-1 +- update to 2.6.29 +- remove DDR patch which became part of sourc +- add patch with correct headers 1957a322c9932e1a1d2ca1fd37ce4b335ceb7113 + +* Wed Feb 25 2009 Fedora Release Engineering - 2.6.28-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Wed Feb 4 2009 Marcela Mašláňová - 2.6.28-2 +- 483484 install distribution files into /usr/share and also fixed + install paths in spec +- add the latest change from git which add DRR support + c86f34942a0ce9f8203c0c38f9fe9604f96be706 + +* Mon Jan 19 2009 Marcela Mašláňová - 2.6.28-1 +- previous two patches were included into 2.6.28 release. +- update + +* Mon Jan 12 2009 Marcela Mašláňová - 2.6.27-2 +- 475130 - Negative preferred lifetimes of IPv6 prefixes/addresses + displayed incorrectly +- 472878 - “ip maddr show” in IB interface causes a stack corruption +- both patches will be probably in iproute v2.6.28 + +* Thu Dec 4 2008 Marcela Maslanova - 2.6.27-1 +- aead support was included into upstream version +- patch for moving libs is now deprecated +- update to 2.6.27 + +* Tue Aug 12 2008 Marcela Maslanova - 2.6.26-1 +- update to 2.6.26 +- clean patches + +* Tue Jul 22 2008 Marcela Maslanova - 2.6.25-5 +- fix iproute2-2.6.25-segfault.patch + +* Thu Jul 10 2008 Tom "spot" Callaway - 2.6.25-4 +- rebuild for new db4-4.7 + +* Thu Jul 3 2008 Marcela Maslanova - 2.6.25-3 +- 449933 instead of failing strncpy use copying byte after byte + +* Wed May 14 2008 Marcela Maslanova - 2.6.25-2 +- allow replay setting, solve also 444724 + +* Mon Apr 21 2008 Marcela Maslanova - 2.6.25-1 +- update +- remove patch for backward compatibility +- add patch for AEAD compatibility + +* Thu Feb 21 2008 Marcela Maslanova - 2.6.23-4 +- add creating ps file again. Fix was done in texlive + +* Wed Feb 6 2008 Marcela Maslanova - 2.6.23-3 +- rebuild without tetex files. It isn't working in rawhide yet. Added + new source for ps files. +- #431179 backward compatibility for previous iproute versions + +* Mon Jan 21 2008 Marcela Maslanova - 2.6.23-2 +- rebuild with fix tetex and linuxdoc-tools -> manual pdf +- clean unnecessary patches +- add into spec *.so objects, new BR linux-atm-libs-devel + +* Wed Oct 31 2007 Marcela Maslanova - 2.6.23-1 +- new version from upstrem 2.3.23 + +* Tue Oct 23 2007 Marcela Maslanova - 2.6.22-5 +- move files from /usr/lib/tc to /usr/share/tc +- remove listing files twice + +* Fri Aug 31 2007 Marcela Maslanova - 2.6.22-3 +- package review #225903 + +* Mon Aug 27 2007 Jeremy Katz - 2.6.22-2 +- rebuild for new db4 + +* Wed Jul 11 2007 Radek Vokál - 2.6.22-1 +- upgrade to 2.6.22 + +* Mon Mar 19 2007 Radek Vokál - 2.6.20-2 +- fix broken tc-pfifo man page (#232891) + +* Thu Mar 15 2007 Radek Vokál - 2.6.20-1 +- upgrade to 2.6.20 + +* Fri Dec 15 2006 Radek Vokál - 2.6.19-1 +- upgrade to 2.6.19 + +* Mon Dec 11 2006 Radek Vokál - 2.6.18-5 +- fix snapshot version + +* Fri Dec 1 2006 Radek Vokál - 2.6.18-4 +- spec file cleanup +- one more rebuilt against db4 + +* Thu Nov 16 2006 Radek Vokál - 2.6.18-3 +- fix defective manpage for tc-pfifo (#215399) + +* Mon Nov 13 2006 Radek Vokál - 2.6.18-2 +- rebuilt against new db4 + +* Tue Oct 3 2006 Radek Vokal - 2.6.18-1 +- upgrade to upstream 2.6.18 +- initcwnd patch merged +- bug fix for xfrm monitor +- alignment fixes for cris +- documentation corrections + +* Mon Oct 2 2006 Radek Vokal - 2.6.16-7 +- fix ip.8 man page, add initcwnd option + +* Sun Oct 01 2006 Jesse Keating - 2.6.16-6 +- rebuilt for unwind info generation, broken in gcc-4.1.1-21 + +* Tue Sep 19 2006 Radek Vokal - 2.6.16-5 +- fix crash when resolving ip address + +* Mon Aug 21 2006 Radek Vokál - 2.6.16-4 +- add LOWER_UP and DORMANT flags (#202199) +- use dist tag + +* Wed Jul 12 2006 Jesse Keating - 2.6.16-3.1 +- rebuild + +* Mon Jun 26 2006 Radek Vokál - 2.6.16-3 +- improve handling of initcwnd value (#179719) + +* Sun May 28 2006 Radek Vokál - 2.6.16-2 +- fix BuildRequires: flex (#193403) + +* Sun Mar 26 2006 Radek Vokál - 2.6.16-1 +- upgrade to 2.6.16-060323 +- don't hardcode /usr/lib in tc (#186607) + +* Wed Feb 22 2006 Radek Vokál - 2.6.15-2 +- own /usr/lib/tc (#181953) +- obsoletes shapecfg (#182284) + +* Fri Feb 10 2006 Jesse Keating - 2.6.15-1.2 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 2.6.15-1.1 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Tue Jan 17 2006 Radek Vokal 2.6.15-1 +- upgrade to 2.6.15-060110 + +* Mon Dec 12 2005 Radek Vokal 2.6.14-11 +- rebuilt + +* Fri Dec 09 2005 Radek Vokal 2.6.14-10 +- remove backup of config files (#175302) + +* Fri Nov 11 2005 Radek Vokal 2.6.14-9 +- use tc manpages and cbq.init from source tarball (#172851) + +* Thu Nov 10 2005 Radek Vokal 2.6.14-8 +- new upstream source + +* Mon Oct 31 2005 Radek Vokal 2.6.14-7 +- add warning to ip tunnel add command (#128107) + +* Fri Oct 07 2005 Bill Nottingham 2.6.14-6 +- update from upstream (appears to fix #170111) + +* Fri Oct 07 2005 Radek Vokal 2.6.14-5 +- update from upstream +- fixed host_len size for memcpy (#168903) + +* Fri Sep 23 2005 Radek Vokal 2.6.14-4 +- add RPM_OPT_FLAGS + +* Mon Sep 19 2005 Radek Vokal 2.6.14-3 +- forget to apply the patch :( + +* Mon Sep 19 2005 Radek Vokal 2.6.14-2 +- make ip help work again (#168449) + +* Wed Sep 14 2005 Radek Vokal 2.6.14-1 +- upgrade to ss050901 for 2.6.14 kernel headers + +* Fri Aug 26 2005 Radek Vokal 2.6.13-3 +- added /sbin/cbq script and sample configuration files (#166301) + +* Fri Aug 19 2005 Radek Vokal 2.6.13-2 +- upgrade to iproute2-050816 + +* Thu Aug 11 2005 Radek Vokal 2.6.13-1 +- update to snapshot for 2.6.13+ kernel + +* Tue May 24 2005 Radek Vokal 2.6.11-2 +- removed useless initvar patch (#150798) +- new upstream source + +* Tue Mar 15 2005 Radek Vokal 2.6.11-1 +- update to iproute-2.6.11 + +* Fri Mar 04 2005 Radek Vokal 2.6.10-2 +- gcc4 rebuilt + +* Wed Feb 16 2005 Radek Vokal 2.6.10-1 +- update to iproute-2.6.10 + +* Thu Dec 23 2004 Radek Vokal 2.6.9-6 +- added arpd into sbin + +* Mon Nov 29 2004 Radek Vokal 2.6.9-5 +- debug info removed from makefile and from spec (#140891) + +* Tue Nov 16 2004 Radek Vokal 2.6.9-4 +- source file updated from snapshot version +- endian patch adding + +* Sat Sep 18 2004 Joshua Blanton 2.6.9-3 +- added installation of netem module for tc + +* Mon Sep 06 2004 Radek Vokal 2.6.9-2 +- fixed possible buffer owerflow, path by Steve Grubb + +* Wed Sep 01 2004 Radek Vokal 2.6.9-1 +- updated to iproute-2.6.9, spec file change, patches cleared + +* Tue Jun 15 2004 Elliot Lee +- rebuilt + +* Wed May 26 2004 Phil Knirsch 2.4.7-16 +- Took tons of manpages from debian, much more complete (#123952). + +* Thu May 06 2004 Phil Knirsch 2.4.7-15 +- rebuilt + +* Thu May 06 2004 Phil Knirsch 2.4.7-13.2 +- Built security errata version for FC1. + +* Wed Apr 21 2004 Phil Knirsch 2.4.7-14 +- Fixed -f option for ss (#118355). +- Small description fix (#110997). +- Added initialization of some vars (#74961). +- Added patch to initialize "default" rule as well (#60693). + +* Fri Feb 13 2004 Elliot Lee +- rebuilt + +* Wed Nov 05 2003 Phil Knirsch 2.4.7-12 +- Security errata for netlink (CAN-2003-0856). + +* Thu Oct 23 2003 Phil Knirsch +- Updated to latest version. Used by other distros, so seems stable. ;-) +- Quite a few patches needed updating in that turn. +- Added ss (#107363) and several other new nifty tools. + +* Tue Jun 17 2003 Phil Knirsch +- rebuilt + +* Wed Jun 04 2003 Elliot Lee +- rebuilt + +* Wed Jan 22 2003 Tim Powers +- rebuilt + +* Thu Jan 16 2003 Phil Knirsch 2.4.7-7 +- Added htb3-tc patch from http://luxik.cdi.cz/~devik/qos/htb/ (#75486). + +* Fri Oct 11 2002 Bill Nottingham 2.4.7-6 +- remove flags patch at author's request + +* Fri Jun 21 2002 Tim Powers +- automated rebuild + +* Wed Jun 19 2002 Phil Knirsch 2.4.7-4 +- Don't forcibly strip binaries + +* Mon May 27 2002 Phil Knirsch 2.4.7-3 +- Fixed missing diffserv and atm support in config (#57278). +- Fixed inconsistent numeric base problem for command line (#65473). + +* Tue May 14 2002 Phil Knirsch 2.4.7-2 +- Added patch to fix crosscompiling by Adrian Linkins. + +* Fri Mar 15 2002 Phil Knirsch 2.4.7-1 +- Update to latest stable release 2.4.7-now-ss010824. +- Added simple man page for ip. + +* Wed Aug 8 2001 Bill Nottingham +- allow setting of allmulti & promisc flags (#48669) + +* Mon Jul 02 2001 Than Ngo +- fix build problem in beehive if kernel-sources is not installed + +* Fri May 25 2001 Helge Deller +- updated to iproute2-2.2.4-now-ss001007.tar.gz +- bzip2 source tar file +- "License" replaces "Copyright" +- added "BuildPrereq: tetex-latex tetex-dvips psutils" +- rebuilt for 7.2 + +* Tue May 1 2001 Bill Nottingham +- use the system headers - the included ones are broken +- ETH_P_ECHO went away + +* Sat Jan 6 2001 Jeff Johnson +- test for specific KERNEL_INCLUDE directories. + +* Thu Oct 12 2000 Than Ngo +- rebuild for 7.1 + +* Thu Oct 12 2000 Than Ngo +- add default configuration files for iproute (Bug #10549, #18887) + +* Tue Jul 25 2000 Jakub Jelinek +- fix include-glibc/ to cope with glibc 2.2 new resolver headers + +* Thu Jul 13 2000 Prospector +- automatic rebuild + +* Sun Jun 18 2000 Than Ngo +- rebuilt in the new build environment +- use RPM macros +- handle RPM_OPT_FLAGS + +* Sat Jun 03 2000 Than Ngo +- fix iproute to build with new glibc + +* Fri May 26 2000 Ngo Than +- update to 2.2.4-now-ss000305 +- add configuration files + +* Mon Sep 13 1999 Bill Nottingham +- strip binaries + +* Mon Aug 16 1999 Cristian Gafton +- first build diff --git a/rt_dsfield.deprecated b/rt_dsfield.deprecated deleted file mode 100644 index c8eec63..0000000 --- a/rt_dsfield.deprecated +++ /dev/null @@ -1,17 +0,0 @@ - -# Deprecated values dropped upstream -# Kept in RHEL for backwards-compatibility -0x00 default -0x10 lowdelay -0x08 throughput -0x04 reliability -# This value overlap with ECT, do not use it! -0x02 mincost -# These values seems do not want to die, Cisco likes them by a strange reason. -0x20 priority -0x40 immediate -0x60 flash -0x80 flash-override -0xa0 critical -0xc0 internet -0xe0 network diff --git a/sources b/sources index 9ad54ed..c870a64 100644 --- a/sources +++ b/sources @@ -1,6 +1 @@ -SHA512 (iproute2-6.8.0.tar.xz) = 54e50340a73c8810d69bfd54704b469149731634a97d94da08b5a305592a812131a441e5b646e32b480d61840e2ade29387e54b934effeee8ded4f06e557a5c0 -SHA512 (iproute2-6.10.0.tar.xz) = 706479aa37a25fcf30c525c6abd85e0861e484d046e0636a28dbc52b958d45c9dba70b912f530dedd4b0b496e4b98969e23501bbbb41d3de50810bae014fcb41 -SHA512 (iproute2-6.12.0.tar.xz) = dbd6afb8162a6086e4be9045b8dc53aa563bd4b7abaf43ee13cd7d493730ff0b90e6985f68c6f42d64f4af6a692d0589e0cefd2f24045ec1c10418cfb73940b2 -SHA512 (iproute2-6.14.0.tar.xz) = e79049bdca0e0381f0a93a40e4d597ce59fb509dabc6e8b04a510ff9953f091c67577d6faa62967bd197bf62ab6e56d928558270a1390621431acb237b77fa46 -SHA512 (iproute2-6.16.0.tar.xz) = 88930ea1a3a901594a69dc04e533bfd1de0f5b79f176dedb45f11f01035bd680edccc8e04e56d0922ee430580581c646473a3baa941254739878f7ab946f17df -SHA512 (iproute2-6.17.0.tar.xz) = 3d83d49233c1d984f15d285a46e2ec0eeb820c7cb84cfc84866921f37e8a57d31bc3953be07e8c79ed6079f326a25c3a85f591b0d67f9f689c0c70ccdb0fef77 +SHA512 (iproute2-5.4.0.tar.xz) = 26d1230e10d9ba4466edd3fe95cb6f595df691eeb27b87ae845ceb9da09fe11c2e0daa8d67187121320413f9ee7131fd426182055eb285be7c4de558d9e47051