Compare commits
4 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46a6ef00ea | ||
|
|
490b02f5cd | ||
|
|
ddb90ea693 | ||
|
|
9f56cf9300 |
15 changed files with 634 additions and 120 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1,2 +1,5 @@
|
|||
/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
|
||||
|
|
|
|||
|
|
@ -0,0 +1,41 @@
|
|||
From 8cfac8f16a88bac7453da91aeca9e2c4244ca92a Mon Sep 17 00:00:00 2001
|
||||
From: Andrea Claudi <aclaudi@redhat.com>
|
||||
Date: Tue, 9 Jul 2019 15:16:50 +0200
|
||||
Subject: [PATCH] Revert "ip6tunnel: fix 'ip -6 {show|change} dev <name>' cmds"
|
||||
|
||||
This reverts commit ba126dcad20e6d0e472586541d78bdd1ac4f1123.
|
||||
It breaks tunnel creation when using 'dev' parameter:
|
||||
|
||||
$ ip link add type dummy
|
||||
$ ip -6 tunnel add ip6tnl1 mode ip6ip6 remote 2001:db8:ffff:100::2 local 2001:db8:ffff:100::1 hoplimit 1 tclass 0x0 dev dummy0
|
||||
add tunnel "ip6tnl0" failed: File exists
|
||||
|
||||
dev parameter must be used to specify the device to which
|
||||
the tunnel is binded, and not the tunnel itself.
|
||||
|
||||
Reported-by: Jianwen Ji <jiji@redhat.com>
|
||||
Reviewed-by: Matteo Croce <mcroce@redhat.com>
|
||||
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
|
||||
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
||||
(cherry picked from commit ad04dbc5b41df509cd6925eab36af73000632fd2)
|
||||
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
||||
---
|
||||
ip/ip6tunnel.c | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/ip/ip6tunnel.c b/ip/ip6tunnel.c
|
||||
index 56fd3466ed062..999408ed801b1 100644
|
||||
--- a/ip/ip6tunnel.c
|
||||
+++ b/ip/ip6tunnel.c
|
||||
@@ -298,8 +298,6 @@ static int parse_args(int argc, char **argv, int cmd, struct ip6_tnl_parm2 *p)
|
||||
p->link = ll_name_to_index(medium);
|
||||
if (!p->link)
|
||||
return nodev(medium);
|
||||
- else
|
||||
- strlcpy(p->name, medium, sizeof(p->name));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
2.22.0
|
||||
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
From 00e0e82a31cede883b2784f08377008c3e996857 Mon Sep 17 00:00:00 2001
|
||||
From: "Dmitry V. Levin" <ldv@altlinux.org>
|
||||
Date: Tue, 8 Jan 2019 01:37:15 +0300
|
||||
Subject: [PATCH] configure: fix typo in check_xt_old_internal_h
|
||||
|
||||
Fixes: 377a09902a57 ("configure: Minor code cleanup")
|
||||
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
|
||||
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
||||
(cherry picked from commit db4ad742e196a3d76cd72ae1257bf444584fa5c5)
|
||||
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
||||
---
|
||||
configure | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index b85eb58b2ba9e..45fcffb69bb53 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -115,7 +115,7 @@ EOF
|
||||
check_xt_old_internal_h()
|
||||
{
|
||||
# bail if previous XT checks has already succeeded.
|
||||
- grep -q if grep -q TC_CONFIG_XT $CONFIG && return
|
||||
+ grep -q TC_CONFIG_XT $CONFIG && return
|
||||
|
||||
#check if we need our own internal.h
|
||||
cat >$TMPDIR/ipttest.c <<EOF
|
||||
--
|
||||
2.20.1
|
||||
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
From 141c6e6397d373126bba14982678dd6f1e9fbfd7 Mon Sep 17 00:00:00 2001
|
||||
From: Andrea Claudi <aclaudi@redhat.com>
|
||||
Date: Tue, 9 Jul 2019 15:16:51 +0200
|
||||
Subject: [PATCH] ip tunnel: warn when changing IPv6 tunnel without tunnel name
|
||||
|
||||
Tunnel change fails if a tunnel name is not specified while using
|
||||
'ip -6 tunnel change'. However, no warning message is printed and
|
||||
no error code is returned.
|
||||
|
||||
$ ip -6 tunnel add ip6tnl1 mode ip6gre local fd::1 remote fd::2 tos inherit ttl 127 encaplimit none dev dummy0
|
||||
$ ip -6 tunnel change dev dummy0 local 2001:1234::1 remote 2001:1234::2
|
||||
$ ip -6 tunnel show ip6tnl1
|
||||
ip6tnl1: gre/ipv6 remote fd::2 local fd::1 dev dummy0 encaplimit none hoplimit 127 tclass inherit flowlabel 0x00000 (flowinfo 0x00000000)
|
||||
|
||||
This commit checks if tunnel interface name is equal to an empty
|
||||
string: in this case, it prints a warning message to the user.
|
||||
It intentionally avoids to return an error to not break existing
|
||||
script setup.
|
||||
|
||||
This is the output after this commit:
|
||||
$ ip -6 tunnel add ip6tnl1 mode ip6gre local fd::1 remote fd::2 tos inherit ttl 127 encaplimit none dev dummy0
|
||||
$ ip -6 tunnel change dev dummy0 local 2001:1234::1 remote 2001:1234::2
|
||||
Tunnel interface name not specified
|
||||
$ ip -6 tunnel show ip6tnl1
|
||||
ip6tnl1: gre/ipv6 remote fd::2 local fd::1 dev dummy0 encaplimit none hoplimit 127 tclass inherit flowlabel 0x00000 (flowinfo 0x00000000)
|
||||
|
||||
Reviewed-by: Matteo Croce <mcroce@redhat.com>
|
||||
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
|
||||
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
||||
(cherry picked from commit d035cc1b4e83e2589ea2115cdc2fa7c6d3693a5a)
|
||||
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
||||
---
|
||||
ip/ip6tunnel.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/ip/ip6tunnel.c b/ip/ip6tunnel.c
|
||||
index 999408ed801b1..e3da11eb4518e 100644
|
||||
--- a/ip/ip6tunnel.c
|
||||
+++ b/ip/ip6tunnel.c
|
||||
@@ -386,6 +386,9 @@ static int do_add(int cmd, int argc, char **argv)
|
||||
if (parse_args(argc, argv, cmd, &p) < 0)
|
||||
return -1;
|
||||
|
||||
+ if (!*p.name)
|
||||
+ fprintf(stderr, "Tunnel interface name not specified\n");
|
||||
+
|
||||
if (p.proto == IPPROTO_GRE)
|
||||
basedev = "ip6gre0";
|
||||
else if (p.i_flags & VTI_ISVTI)
|
||||
--
|
||||
2.22.0
|
||||
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
From 806106d6e17f7910c63bed52a046ba4d2d158f7a Mon Sep 17 00:00:00 2001
|
||||
From: Luca Boccassi <bluca@debian.org>
|
||||
Date: Sat, 12 Jan 2019 12:28:54 +0000
|
||||
Subject: [PATCH] man: ss.8: more line breaks
|
||||
|
||||
groff stiff complains about unbreakable lines:
|
||||
96: warning [p 2, 3.0i]: can't break line
|
||||
|
||||
Indent it some more.
|
||||
|
||||
Fixes: 7f5047524c99 ("man: ss.8: break and indent long line")
|
||||
|
||||
Signed-off-by: Luca Boccassi <bluca@debian.org>
|
||||
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
||||
(cherry picked from commit cffeeb39466bdfcead182138e1f4c6881384ab16)
|
||||
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
||||
---
|
||||
man/man8/ss.8 | 10 ++++++++--
|
||||
1 file changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/man/man8/ss.8 b/man/man8/ss.8
|
||||
index f138c91a1fcc4..553a6cf46f0e2 100644
|
||||
--- a/man/man8/ss.8
|
||||
+++ b/man/man8/ss.8
|
||||
@@ -89,11 +89,17 @@ an uuid of the socket
|
||||
Show socket memory usage. The output format is:
|
||||
.RS
|
||||
.P
|
||||
-skmem:(r<rmem_alloc>,rb<rcv_buf>,t<wmem_alloc>,tb<snd_buf>,f<fwd_alloc>,
|
||||
+skmem:(r<rmem_alloc>,rb<rcv_buf>,t<wmem_alloc>,tb<snd_buf>,
|
||||
.br
|
||||
.RS
|
||||
.RS
|
||||
-w<wmem_queued>,o<opt_mem>,bl<back_log>)
|
||||
+f<fwd_alloc>,w<wmem_queued>,
|
||||
+.RE
|
||||
+.RE
|
||||
+.br
|
||||
+.RS
|
||||
+.RS
|
||||
+o<opt_mem>,bl<back_log>)
|
||||
.RE
|
||||
.RE
|
||||
.P
|
||||
--
|
||||
2.20.1
|
||||
|
||||
78
0003-ip-route-fix-json-formatting-for-metrics.patch
Normal file
78
0003-ip-route-fix-json-formatting-for-metrics.patch
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
From 9da7fb1dd27624ed6ab62f5595451f43c3a07d2d Mon Sep 17 00:00:00 2001
|
||||
From: Andrea Claudi <aclaudi@redhat.com>
|
||||
Date: Mon, 8 Jul 2019 11:36:42 +0200
|
||||
Subject: [PATCH] ip-route: fix json formatting for metrics
|
||||
|
||||
Setting metrics for routes currently lead to non-parsable
|
||||
json output. For example:
|
||||
|
||||
$ ip link add type dummy
|
||||
$ ip route add 192.168.2.0 dev dummy0 metric 100 mtu 1000 rto_min 3
|
||||
$ ip -j route | jq
|
||||
parse error: ':' not as part of an object at line 1, column 319
|
||||
|
||||
Fixing this opening a json object in the metrics array and using
|
||||
print_string() instead of fprintf().
|
||||
|
||||
This is the output for the above commands applying this patch:
|
||||
|
||||
$ ip -j route | jq
|
||||
[
|
||||
{
|
||||
"dst": "192.168.2.0",
|
||||
"dev": "dummy0",
|
||||
"scope": "link",
|
||||
"metric": 100,
|
||||
"flags": [],
|
||||
"metrics": [
|
||||
{
|
||||
"mtu": 1000,
|
||||
"rto_min": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
Fixes: 663c3cb23103f ("iproute: implement JSON and color output")
|
||||
Fixes: 968272e791710 ("iproute: refactor metrics print")
|
||||
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
|
||||
Reported-by: Frank Hofmann <fhofmann@cloudflare.com>
|
||||
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
||||
(cherry picked from commit 89ce8012d71f5689074dc4cbe3db102cbdf76460)
|
||||
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
||||
---
|
||||
ip/iproute.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/ip/iproute.c b/ip/iproute.c
|
||||
index 1669e0138259e..2f9b612b0b506 100644
|
||||
--- a/ip/iproute.c
|
||||
+++ b/ip/iproute.c
|
||||
@@ -578,6 +578,7 @@ static void print_rta_metrics(FILE *fp, const struct rtattr *rta)
|
||||
int i;
|
||||
|
||||
open_json_array(PRINT_JSON, "metrics");
|
||||
+ open_json_object(NULL);
|
||||
|
||||
parse_rtattr(mxrta, RTAX_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta));
|
||||
|
||||
@@ -611,7 +612,7 @@ static void print_rta_metrics(FILE *fp, const struct rtattr *rta)
|
||||
print_rtax_features(fp, val);
|
||||
break;
|
||||
default:
|
||||
- fprintf(fp, "%u ", val);
|
||||
+ print_uint(PRINT_ANY, mx_names[i], "%u ", val);
|
||||
break;
|
||||
|
||||
case RTAX_RTT:
|
||||
@@ -639,6 +640,7 @@ static void print_rta_metrics(FILE *fp, const struct rtattr *rta)
|
||||
}
|
||||
}
|
||||
|
||||
+ close_json_object();
|
||||
close_json_array(PRINT_JSON, NULL);
|
||||
}
|
||||
|
||||
--
|
||||
2.22.0
|
||||
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
From 06dfededed954e6d98450ae8f57d561359f2430e Mon Sep 17 00:00:00 2001
|
||||
From: Luca Boccassi <bluca@debian.org>
|
||||
Date: Sat, 12 Jan 2019 12:28:55 +0000
|
||||
Subject: [PATCH] man: tc-taprio.8: fix syntax error
|
||||
|
||||
.Q does not exist so groff complains and the "queues" word is actually
|
||||
not displayed.
|
||||
|
||||
Fixes: 579acb4bc52f ("taprio: Add manpage for tc-taprio(8)")
|
||||
|
||||
Signed-off-by: Luca Boccassi <bluca@debian.org>
|
||||
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
||||
(cherry picked from commit 8242808ced032d56d690ae66a93fa52e8d0ada9a)
|
||||
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
||||
---
|
||||
man/man8/tc-taprio.8 | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/man/man8/tc-taprio.8 b/man/man8/tc-taprio.8
|
||||
index 92055b434b942..850be9b036491 100644
|
||||
--- a/man/man8/tc-taprio.8
|
||||
+++ b/man/man8/tc-taprio.8
|
||||
@@ -45,7 +45,7 @@ How traffic is mapped to different hardware queues is similar to
|
||||
and so the
|
||||
.B map
|
||||
and
|
||||
-.Q queues
|
||||
+.B queues
|
||||
parameters have the same meaning.
|
||||
|
||||
The other parameters specify the schedule, and at what point in time
|
||||
--
|
||||
2.20.1
|
||||
|
||||
113
0004-utils-move-parse_percent-to-tc_util.patch
Normal file
113
0004-utils-move-parse_percent-to-tc_util.patch
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
From 5b17171ce7363e597009e07fb143522a2d79c77b Mon Sep 17 00:00:00 2001
|
||||
From: Andrea Claudi <aclaudi@redhat.com>
|
||||
Date: Fri, 28 Jun 2019 18:03:45 +0200
|
||||
Subject: [PATCH] utils: move parse_percent() to tc_util
|
||||
|
||||
As parse_percent() is used only in tc.
|
||||
|
||||
This reduces ip, bridge and genl binaries size:
|
||||
|
||||
$ bloat-o-meter -t bridge/bridge bridge/bridge.new
|
||||
add/remove: 0/1 grow/shrink: 0/0 up/down: 0/-109 (-109)
|
||||
Total: Before=50973, After=50864, chg -0.21%
|
||||
|
||||
$ bloat-o-meter -t genl/genl genl/genl.new
|
||||
add/remove: 0/1 grow/shrink: 0/0 up/down: 0/-109 (-109)
|
||||
Total: Before=30298, After=30189, chg -0.36%
|
||||
|
||||
$ bloat-o-meter ip/ip ip/ip.new
|
||||
add/remove: 0/1 grow/shrink: 0/0 up/down: 0/-109 (-109)
|
||||
Total: Before=674164, After=674055, chg -0.02%
|
||||
|
||||
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
|
||||
Signed-off-by: David Ahern <dsahern@gmail.com>
|
||||
(cherry picked from commit 1e5746d5e13d895b63da954f0290cffbb076cefa)
|
||||
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
||||
---
|
||||
include/utils.h | 1 -
|
||||
lib/utils.c | 16 ----------------
|
||||
tc/tc_util.c | 16 ++++++++++++++++
|
||||
tc/tc_util.h | 1 +
|
||||
4 files changed, 17 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/include/utils.h b/include/utils.h
|
||||
index 927fdc17e09dd..f9a4916b517ab 100644
|
||||
--- a/include/utils.h
|
||||
+++ b/include/utils.h
|
||||
@@ -145,7 +145,6 @@ int get_addr_rta(inet_prefix *dst, const struct rtattr *rta, int family);
|
||||
int get_addr_ila(__u64 *val, const char *arg);
|
||||
|
||||
int read_prop(const char *dev, char *prop, long *value);
|
||||
-int parse_percent(double *val, const char *str);
|
||||
int get_hex(char c);
|
||||
int get_integer(int *val, const char *arg, int base);
|
||||
int get_unsigned(unsigned *val, const char *arg, int base);
|
||||
diff --git a/lib/utils.c b/lib/utils.c
|
||||
index be0f11b00280d..5da9a47848966 100644
|
||||
--- a/lib/utils.c
|
||||
+++ b/lib/utils.c
|
||||
@@ -101,22 +101,6 @@ out:
|
||||
return -1;
|
||||
}
|
||||
|
||||
-/* Parse a percent e.g: '30%'
|
||||
- * return: 0 = ok, -1 = error, 1 = out of range
|
||||
- */
|
||||
-int parse_percent(double *val, const char *str)
|
||||
-{
|
||||
- char *p;
|
||||
-
|
||||
- *val = strtod(str, &p) / 100.;
|
||||
- if (*val == HUGE_VALF || *val == HUGE_VALL)
|
||||
- return 1;
|
||||
- if (*p && strcmp(p, "%"))
|
||||
- return -1;
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
int get_hex(char c)
|
||||
{
|
||||
if (c >= 'A' && c <= 'F')
|
||||
diff --git a/tc/tc_util.c b/tc/tc_util.c
|
||||
index e5d15281581df..53d15e08e9734 100644
|
||||
--- a/tc/tc_util.c
|
||||
+++ b/tc/tc_util.c
|
||||
@@ -190,6 +190,22 @@ static const struct rate_suffix {
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
+/* Parse a percent e.g: '30%'
|
||||
+ * return: 0 = ok, -1 = error, 1 = out of range
|
||||
+ */
|
||||
+int parse_percent(double *val, const char *str)
|
||||
+{
|
||||
+ char *p;
|
||||
+
|
||||
+ *val = strtod(str, &p) / 100.;
|
||||
+ if (*val == HUGE_VALF || *val == HUGE_VALL)
|
||||
+ return 1;
|
||||
+ if (*p && strcmp(p, "%"))
|
||||
+ return -1;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int parse_percent_rate(char *rate, size_t len,
|
||||
const char *str, const char *dev)
|
||||
{
|
||||
diff --git a/tc/tc_util.h b/tc/tc_util.h
|
||||
index 825fea36a0809..eb4b60db3fdd7 100644
|
||||
--- a/tc/tc_util.h
|
||||
+++ b/tc/tc_util.h
|
||||
@@ -101,6 +101,7 @@ int print_tc_classid(char *buf, int len, __u32 h);
|
||||
char *sprint_tc_classid(__u32 h, char *buf);
|
||||
|
||||
int tc_print_police(FILE *f, struct rtattr *tb);
|
||||
+int parse_percent(double *val, const char *str);
|
||||
int parse_police(int *argc_p, char ***argv_p, int tca_id, struct nlmsghdr *n);
|
||||
|
||||
int parse_action_control(int *argc_p, char ***argv_p,
|
||||
--
|
||||
2.22.0
|
||||
|
||||
97
0005-tc-util-constrain-percentage-in-0-100-interval.patch
Normal file
97
0005-tc-util-constrain-percentage-in-0-100-interval.patch
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
From 29a5b8d072d06b685c428f15125ff62b8b470064 Mon Sep 17 00:00:00 2001
|
||||
From: Andrea Claudi <aclaudi@redhat.com>
|
||||
Date: Sat, 13 Jul 2019 11:44:07 +0200
|
||||
Subject: [PATCH] tc: util: constrain percentage in 0-100 interval
|
||||
|
||||
parse_percent() currently allows to specify negative percentages
|
||||
or value above 100%. However this does not seems to make sense,
|
||||
as the function is used for probabilities or bandiwidth rates.
|
||||
|
||||
Moreover, using negative values leads to erroneous results
|
||||
(using Bernoulli loss model as example):
|
||||
|
||||
$ ip link add test type dummy
|
||||
$ ip link set test up
|
||||
$ tc qdisc add dev test root netem loss gemodel -10% limit 10
|
||||
$ tc qdisc show dev test
|
||||
qdisc netem 800c: root refcnt 2 limit 10 loss gemodel p 90% r 10% 1-h 100% 1-k 0%
|
||||
|
||||
Using values above 100% we have instead:
|
||||
|
||||
$ ip link add test type dummy
|
||||
$ ip link set test up
|
||||
$ tc qdisc add dev test root netem loss gemodel 140% limit 10
|
||||
$ tc qdisc show dev test
|
||||
qdisc netem 800f: root refcnt 2 limit 10 loss gemodel p 40% r 60% 1-h 100% 1-k 0%
|
||||
|
||||
This commit changes parse_percent() with a check to ensure
|
||||
percentage values stay between 1.0 and 0.0.
|
||||
parse_percent_rate() function, which already employs a similar
|
||||
check, is adjusted accordingly.
|
||||
|
||||
With this check in place, we have:
|
||||
|
||||
$ ip link add test type dummy
|
||||
$ ip link set test up
|
||||
$ tc qdisc add dev test root netem loss gemodel -10% limit 10
|
||||
Illegal "loss gemodel p"
|
||||
|
||||
Fixes: 927e3cfb52b58 ("tc: B.W limits can now be specified in %.")
|
||||
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
|
||||
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
||||
(cherry picked from commit 6bc13e4a20f50e9c37d5a504c78222913c433fd3)
|
||||
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
||||
---
|
||||
tc/tc_util.c | 17 +++++++++--------
|
||||
1 file changed, 9 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/tc/tc_util.c b/tc/tc_util.c
|
||||
index 53d15e08e9734..b90d256c33a4a 100644
|
||||
--- a/tc/tc_util.c
|
||||
+++ b/tc/tc_util.c
|
||||
@@ -198,7 +198,7 @@ int parse_percent(double *val, const char *str)
|
||||
char *p;
|
||||
|
||||
*val = strtod(str, &p) / 100.;
|
||||
- if (*val == HUGE_VALF || *val == HUGE_VALL)
|
||||
+ if (*val > 1.0 || *val < 0.0)
|
||||
return 1;
|
||||
if (*p && strcmp(p, "%"))
|
||||
return -1;
|
||||
@@ -226,16 +226,16 @@ static int parse_percent_rate(char *rate, size_t len,
|
||||
if (ret != 1)
|
||||
goto malf;
|
||||
|
||||
- if (parse_percent(&perc, str_perc))
|
||||
+ ret = parse_percent(&perc, str_perc);
|
||||
+ if (ret == 1) {
|
||||
+ fprintf(stderr, "Invalid rate specified; should be between [0,100]%% but is %s\n", str);
|
||||
+ goto err;
|
||||
+ } else if (ret == -1) {
|
||||
goto malf;
|
||||
+ }
|
||||
|
||||
free(str_perc);
|
||||
|
||||
- if (perc > 1.0 || perc < 0.0) {
|
||||
- fprintf(stderr, "Invalid rate specified; should be between [0,100]%% but is %s\n", str);
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
rate_bit = perc * dev_mbit * 1000 * 1000;
|
||||
|
||||
ret = snprintf(rate, len, "%lf", rate_bit);
|
||||
@@ -247,8 +247,9 @@ static int parse_percent_rate(char *rate, size_t len,
|
||||
return 0;
|
||||
|
||||
malf:
|
||||
- free(str_perc);
|
||||
fprintf(stderr, "Specified rate value could not be read or is malformed\n");
|
||||
+err:
|
||||
+ free(str_perc);
|
||||
return -1;
|
||||
}
|
||||
|
||||
--
|
||||
2.22.0
|
||||
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
From f12ee1269f04a5f4ab5c18326004af32da4061ae Mon Sep 17 00:00:00 2001
|
||||
From: Aya Levin <ayal@mellanox.com>
|
||||
Date: Wed, 10 Jul 2019 14:03:19 +0300
|
||||
Subject: [PATCH] devlink: Change devlink health dump show command to dumpit
|
||||
|
||||
Although devlink health dump show command is given per reporter, it
|
||||
returns large amounts of data. Trying to use the doit cb results in
|
||||
OUT-OF-BUFFER error. This complementary patch raises the DUMP flag in
|
||||
order to invoke the dumpit cb. We're safe as no existing drivers
|
||||
implement the dump health reporter option yet.
|
||||
|
||||
Fixes: 041e6e651a8e ("devlink: Add devlink health dump show command")
|
||||
Signed-off-by: Aya Levin <ayal@mellanox.com>
|
||||
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
|
||||
Acked-by: Jiri Pirko <jiri@mellanox.com>
|
||||
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
||||
(cherry picked from commit b4d97ef57fd4b7669971ed209065a72d115dffc2)
|
||||
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
||||
---
|
||||
devlink/devlink.c | 12 ++++++++----
|
||||
1 file changed, 8 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/devlink/devlink.c b/devlink/devlink.c
|
||||
index 5618ba26d6fb3..9c338cb4ccc84 100644
|
||||
--- a/devlink/devlink.c
|
||||
+++ b/devlink/devlink.c
|
||||
@@ -6072,13 +6072,13 @@ static int cmd_fmsg_object_cb(const struct nlmsghdr *nlh, void *data)
|
||||
return MNL_CB_OK;
|
||||
}
|
||||
|
||||
-static int cmd_health_object_common(struct dl *dl, uint8_t cmd)
|
||||
+static int cmd_health_object_common(struct dl *dl, uint8_t cmd, uint16_t flags)
|
||||
{
|
||||
struct fmsg_cb_data data;
|
||||
struct nlmsghdr *nlh;
|
||||
int err;
|
||||
|
||||
- nlh = mnlg_msg_prepare(dl->nlg, cmd, NLM_F_REQUEST | NLM_F_ACK);
|
||||
+ nlh = mnlg_msg_prepare(dl->nlg, cmd, flags | NLM_F_REQUEST | NLM_F_ACK);
|
||||
|
||||
err = dl_argv_parse_put(nlh, dl,
|
||||
DL_OPT_HANDLE | DL_OPT_HEALTH_REPORTER_NAME, 0);
|
||||
@@ -6093,12 +6093,16 @@ static int cmd_health_object_common(struct dl *dl, uint8_t cmd)
|
||||
|
||||
static int cmd_health_dump_show(struct dl *dl)
|
||||
{
|
||||
- return cmd_health_object_common(dl, DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET);
|
||||
+ return cmd_health_object_common(dl,
|
||||
+ DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET,
|
||||
+ NLM_F_DUMP);
|
||||
}
|
||||
|
||||
static int cmd_health_diagnose(struct dl *dl)
|
||||
{
|
||||
- return cmd_health_object_common(dl, DEVLINK_CMD_HEALTH_REPORTER_DIAGNOSE);
|
||||
+ return cmd_health_object_common(dl,
|
||||
+ DEVLINK_CMD_HEALTH_REPORTER_DIAGNOSE,
|
||||
+ 0);
|
||||
}
|
||||
|
||||
static int cmd_health_recover(struct dl *dl)
|
||||
--
|
||||
2.22.0
|
||||
|
||||
83
0007-devlink-Fix-binary-values-print.patch
Normal file
83
0007-devlink-Fix-binary-values-print.patch
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
From 4aaf5d7099e7b985973b49f59ceef9b1fd6f6810 Mon Sep 17 00:00:00 2001
|
||||
From: Aya Levin <ayal@mellanox.com>
|
||||
Date: Wed, 10 Jul 2019 14:03:20 +0300
|
||||
Subject: [PATCH] devlink: Fix binary values print
|
||||
|
||||
Fix function pr_out_binary_value() to start printing the binary buffer
|
||||
from offset 0 instead of offset 1. Remove redundant new line at the
|
||||
beginning of the output
|
||||
|
||||
Example:
|
||||
With patch:
|
||||
mlx5e_txqsq:
|
||||
05 00 00 00 05 00 00 00 01 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 8e 6e 3a 13 07 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
c0
|
||||
Without patch
|
||||
mlx5e_txqsq:
|
||||
|
||||
00 00 00 05 00 00 00 01 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 8e 6e 3a 13 07 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 c0
|
||||
|
||||
Fixes: 844a61764c6f ("devlink: Add helper functions for name and value separately")
|
||||
Signed-off-by: Aya Levin <ayal@mellanox.com>
|
||||
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
|
||||
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
||||
(cherry picked from commit 1d05cca2fd70a5bc8a9f4e978aa5629dbc99a973)
|
||||
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
||||
---
|
||||
devlink/devlink.c | 24 +++++++++++++-----------
|
||||
1 file changed, 13 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/devlink/devlink.c b/devlink/devlink.c
|
||||
index 9c338cb4ccc84..5dff974c93c93 100644
|
||||
--- a/devlink/devlink.c
|
||||
+++ b/devlink/devlink.c
|
||||
@@ -1779,29 +1779,31 @@ static void pr_out_uint64_value(struct dl *dl, uint64_t value)
|
||||
pr_out(" %"PRIu64, value);
|
||||
}
|
||||
|
||||
+static bool is_binary_eol(int i)
|
||||
+{
|
||||
+ return !(i%16);
|
||||
+}
|
||||
+
|
||||
static void pr_out_binary_value(struct dl *dl, uint8_t *data, uint32_t len)
|
||||
{
|
||||
- int i = 1;
|
||||
+ int i = 0;
|
||||
|
||||
if (dl->json_output)
|
||||
jsonw_start_array(dl->jw);
|
||||
- else
|
||||
- pr_out("\n");
|
||||
|
||||
while (i < len) {
|
||||
- if (dl->json_output) {
|
||||
+ if (dl->json_output)
|
||||
jsonw_printf(dl->jw, "%d", data[i]);
|
||||
- } else {
|
||||
- pr_out(" %02x", data[i]);
|
||||
- if (!(i % 16))
|
||||
- pr_out("\n");
|
||||
- }
|
||||
+ else
|
||||
+ pr_out("%02x ", data[i]);
|
||||
i++;
|
||||
+ if (!dl->json_output && is_binary_eol(i))
|
||||
+ __pr_out_newline();
|
||||
}
|
||||
if (dl->json_output)
|
||||
jsonw_end_array(dl->jw);
|
||||
- else if ((i - 1) % 16)
|
||||
- pr_out("\n");
|
||||
+ else if (!is_binary_eol(i))
|
||||
+ __pr_out_newline();
|
||||
}
|
||||
|
||||
static void pr_out_str_value(struct dl *dl, const char *value)
|
||||
--
|
||||
2.22.0
|
||||
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
From a5d73c80107321aafd1e2007a059a7eb950412d7 Mon Sep 17 00:00:00 2001
|
||||
From: Aya Levin <ayal@mellanox.com>
|
||||
Date: Wed, 10 Jul 2019 14:03:21 +0300
|
||||
Subject: [PATCH] devlink: Remove enclosing array brackets binary print with
|
||||
json format
|
||||
|
||||
Keep pr_out_binary_value function only for printing. Inner relations
|
||||
like array grouping should be done outside the function.
|
||||
|
||||
Fixes: 844a61764c6f ("devlink: Add helper functions for name and value separately")
|
||||
Signed-off-by: Aya Levin <ayal@mellanox.com>
|
||||
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
|
||||
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
||||
(cherry picked from commit f359942a25d368ccf2e47b79f95db2798e09f7a4)
|
||||
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
||||
---
|
||||
devlink/devlink.c | 7 +------
|
||||
1 file changed, 1 insertion(+), 6 deletions(-)
|
||||
|
||||
diff --git a/devlink/devlink.c b/devlink/devlink.c
|
||||
index 5dff974c93c93..ebb1de3eb2eaa 100644
|
||||
--- a/devlink/devlink.c
|
||||
+++ b/devlink/devlink.c
|
||||
@@ -1788,9 +1788,6 @@ static void pr_out_binary_value(struct dl *dl, uint8_t *data, uint32_t len)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
- if (dl->json_output)
|
||||
- jsonw_start_array(dl->jw);
|
||||
-
|
||||
while (i < len) {
|
||||
if (dl->json_output)
|
||||
jsonw_printf(dl->jw, "%d", data[i]);
|
||||
@@ -1800,9 +1797,7 @@ static void pr_out_binary_value(struct dl *dl, uint8_t *data, uint32_t len)
|
||||
if (!dl->json_output && is_binary_eol(i))
|
||||
__pr_out_newline();
|
||||
}
|
||||
- if (dl->json_output)
|
||||
- jsonw_end_array(dl->jw);
|
||||
- else if (!is_binary_eol(i))
|
||||
+ if (!dl->json_output && !is_binary_eol(i))
|
||||
__pr_out_newline();
|
||||
}
|
||||
|
||||
--
|
||||
2.22.0
|
||||
|
||||
30
0009-json-fix-backslash-escape-typo-in-jsonw_puts.patch
Normal file
30
0009-json-fix-backslash-escape-typo-in-jsonw_puts.patch
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
From 742a2436d344ac15330c56a2326c03c8c56686a5 Mon Sep 17 00:00:00 2001
|
||||
From: Ivan Delalande <colona@arista.com>
|
||||
Date: Wed, 17 Jul 2019 18:15:31 -0700
|
||||
Subject: [PATCH] json: fix backslash escape typo in jsonw_puts
|
||||
|
||||
Fixes: fcc16c22 ("provide common json output formatter")
|
||||
Signed-off-by: Ivan Delalande <colona@arista.com>
|
||||
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
||||
(cherry picked from commit ed54f76484b5ee47b190a202ecf29fce60d0d878)
|
||||
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
||||
---
|
||||
lib/json_writer.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/json_writer.c b/lib/json_writer.c
|
||||
index 5004c181e6225..88c5eb8882254 100644
|
||||
--- a/lib/json_writer.c
|
||||
+++ b/lib/json_writer.c
|
||||
@@ -75,7 +75,7 @@ static void jsonw_puts(json_writer_t *self, const char *str)
|
||||
fputs("\\b", self->out);
|
||||
break;
|
||||
case '\\':
|
||||
- fputs("\\n", self->out);
|
||||
+ fputs("\\\\", self->out);
|
||||
break;
|
||||
case '"':
|
||||
fputs("\\\"", self->out);
|
||||
--
|
||||
2.22.0
|
||||
|
||||
33
iproute.spec
33
iproute.spec
|
|
@ -1,14 +1,20 @@
|
|||
%global cbq_version v0.7.3
|
||||
Summary: Advanced IP routing and network device configuration tools
|
||||
Name: iproute
|
||||
Version: 4.20.0
|
||||
Version: 5.2.0
|
||||
Release: 1%{?dist}
|
||||
URL: http://kernel.org/pub/linux/utils/net/%{name}2/
|
||||
Source0: http://kernel.org/pub/linux/utils/net/%{name}2/%{name}2-%{version}.tar.xz
|
||||
|
||||
Patch0: 0001-configure-fix-typo-in-check_xt_old_internal_h.patch
|
||||
Patch1: 0002-man-ss.8-more-line-breaks.patch
|
||||
Patch2: 0003-man-tc-taprio.8-fix-syntax-error.patch
|
||||
Patch1: 0001-Revert-ip6tunnel-fix-ip-6-show-change-dev-name-cmds.patch
|
||||
Patch2: 0002-ip-tunnel-warn-when-changing-IPv6-tunnel-without-tun.patch
|
||||
Patch3: 0003-ip-route-fix-json-formatting-for-metrics.patch
|
||||
Patch4: 0004-utils-move-parse_percent-to-tc_util.patch
|
||||
Patch5: 0005-tc-util-constrain-percentage-in-0-100-interval.patch
|
||||
Patch6: 0006-devlink-Change-devlink-health-dump-show-command-to-d.patch
|
||||
Patch7: 0007-devlink-Fix-binary-values-print.patch
|
||||
Patch8: 0008-devlink-Remove-enclosing-array-brackets-binary-print.patch
|
||||
Patch9: 0009-json-fix-backslash-escape-typo-in-jsonw_puts.patch
|
||||
|
||||
License: GPLv2+ and Public Domain
|
||||
BuildRequires: gcc
|
||||
|
|
@ -26,10 +32,7 @@ BuildRequires: pkgconfig
|
|||
BuildRequires: linux-atm-libs-devel
|
||||
%endif
|
||||
%endif
|
||||
# For the UsrMove transition period
|
||||
Conflicts: filesystem < 3
|
||||
Provides: /sbin/ip
|
||||
Obsoletes: %{name} < 4.5.0-3
|
||||
Recommends: %{name}-tc
|
||||
|
||||
%description
|
||||
|
|
@ -40,7 +43,6 @@ kernel.
|
|||
%package tc
|
||||
Summary: Linux Traffic Control utility
|
||||
License: GPLv2+
|
||||
Obsoletes: %{name} < 4.5.0-3
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
Provides: tc
|
||||
|
||||
|
|
@ -130,6 +132,21 @@ install -D -m644 lib/libnetlink.a %{buildroot}%{_libdir}/libnetlink.a
|
|||
%{_includedir}/iproute2/bpf_elf.h
|
||||
|
||||
%changelog
|
||||
* Tue Jul 23 2019 Phil Sutter <psutter@redhat.com> - 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 <psutter@redhat.com> - 5.1.0-1
|
||||
- New version 5.1.0
|
||||
|
||||
* Wed Mar 20 2019 Phil Sutter <psutter@redhat.com> - 5.0.0-2
|
||||
- Restore Provides: hint, at least pptp depends on it
|
||||
|
||||
* Wed Mar 20 2019 Phil Sutter <psutter@redhat.com> - 5.0.0-1
|
||||
- New version 5.0.0
|
||||
- Get rid of old upgrade path hints
|
||||
|
||||
* Fri Feb 01 2019 Phil Sutter <psutter@redhat.com> - 4.20.0-1
|
||||
- New version 4.20.0
|
||||
- Add upstream-suggested backports
|
||||
|
|
|
|||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (iproute2-4.20.0.tar.xz) = ed29638c864062e199152c7b3b24b6495987ca6f79cc9ab1b529dab37a8a840fa2b5858d5db2b94eeefa1c0d72ff666a790107e27d11a597b189bfb7a01a4b8b
|
||||
SHA512 (iproute2-5.2.0.tar.xz) = 82bbeae29d98129d822c95ff7523186569e32c66132b8d781d501d61f396b04d122e3d13057dd4236455264008e5bfac7cb63c325908fc1c46d416cbde6ac7e1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue