diff --git a/.gitignore b/.gitignore index 7065a5b..3cb8593 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,8 @@ /iproute2-4.10.0.tar.xz /iproute2-4.11.0.tar.xz /iproute2-4.12.0.tar.xz +/iproute2-4.13.0.tar.xz +/iproute2-4.14.1.tar.xz +/iproute2-4.15.0.tar.xz +/iproute2-4.16.0.tar.xz +/iproute2-4.17.0.tar.xz diff --git a/0001-Add-cbq.8-as-an-alias-to-tc-cbq.8.patch b/0001-Add-cbq.8-as-an-alias-to-tc-cbq.8.patch new file mode 100644 index 0000000..20f9f49 --- /dev/null +++ b/0001-Add-cbq.8-as-an-alias-to-tc-cbq.8.patch @@ -0,0 +1,21 @@ +From a6096b55c1984136df8b3c1d372fa4c435c1b588 Mon Sep 17 00:00:00 2001 +From: Phil Sutter +Date: Fri, 17 Mar 2017 22:47:27 +0100 +Subject: [PATCH] Add cbq.8 as an alias to tc-cbq.8 + +Signed-off-by: Phil Sutter +--- + man/man8/cbq.8 | 1 + + 1 file changed, 1 insertion(+) + create mode 100644 man/man8/cbq.8 + +diff --git a/man/man8/cbq.8 b/man/man8/cbq.8 +new file mode 100644 +index 0000000000000..bef35201f4eab +--- /dev/null ++++ b/man/man8/cbq.8 +@@ -0,0 +1 @@ ++.so man8/tc-cbq.8 +-- +2.18.0 + diff --git a/0001-Documentation-fixes.patch b/0001-Documentation-fixes.patch deleted file mode 100644 index 3269037..0000000 --- a/0001-Documentation-fixes.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 2332a21bd43ca69ad38a30109881867b9c5c2ea0 Mon Sep 17 00:00:00 2001 -From: Phil Sutter -Date: Fri, 17 Mar 2017 22:47:27 +0100 -Subject: [PATCH] Documentation fixes - ---- - man/man8/cbq.8 | 1 + - man/man8/ss.8 | 4 ++-- - 2 files changed, 3 insertions(+), 2 deletions(-) - create mode 100644 man/man8/cbq.8 - -diff --git a/man/man8/cbq.8 b/man/man8/cbq.8 -new file mode 100644 -index 00000000..bef35201 ---- /dev/null -+++ b/man/man8/cbq.8 -@@ -0,0 +1 @@ -+.so man8/tc-cbq.8 -diff --git a/man/man8/ss.8 b/man/man8/ss.8 -index 4ef11523..3898bdbd 100644 ---- a/man/man8/ss.8 -+++ b/man/man8/ss.8 -@@ -142,7 +142,7 @@ Read filter information from FILE. - Each line of FILE is interpreted like single command line option. If FILE is - stdin is used. - .TP - .B FILTER := [ state STATE-FILTER ] [ EXPRESSION ] --Please take a look at the official documentation (Debian package iproute-doc) for details regarding filters. -+Please take a look at the official documentation (package iproute\-doc) for details regarding filters. - - .SH STATE-FILTER - -@@ -197,7 +197,7 @@ Find all local processes connected to X server. - List all the tcp sockets in state FIN-WAIT-1 for our apache to network 193.233.7/24 and look at their timers. - .SH SEE ALSO - .BR ip (8), --.BR /usr/share/doc/iproute-doc/ss.html " (package iproute­doc)", -+.BR /usr/share/doc/iproute-doc/ss.ps " (package iproute\-doc)", - .br - .BR RFC " 793 " - - https://tools.ietf.org/rfc/rfc793.txt (TCP states) --- -2.11.0 - diff --git a/0002-tc-fix-batch-force-option.patch b/0002-tc-fix-batch-force-option.patch new file mode 100644 index 0000000..bd55565 --- /dev/null +++ b/0002-tc-fix-batch-force-option.patch @@ -0,0 +1,73 @@ +From 6e35532d0cce6a14d91bb0b9362cc7624e882490 Mon Sep 17 00:00:00 2001 +From: Vlad Buslov +Date: Wed, 20 Jun 2018 10:24:21 +0300 +Subject: [PATCH] tc: fix batch force option + +When sending accumulated compound command results an error, check 'force' +option before exiting. Move return code check after putting batch bufs and +freeing iovs to prevent memory leak. Break from loop, instead of returning +error code to allow cleanup at the end of batch function. Don't reset ret +code on each iteration. + +Fixes: 485d0c6001c4 ("tc: Add batchsize feature for filter and actions") +Reviewed-by: Roi Dayan +Reviewed-by: Chris Mi +Signed-off-by: Vlad Buslov +Signed-off-by: Stephen Hemminger +(cherry picked from commit b133392468d1f404077a8f3554d1f63d48bb45e8) +Signed-off-by: Phil Sutter +--- + tc/tc.c | 19 +++++++++++-------- + 1 file changed, 11 insertions(+), 8 deletions(-) + +diff --git a/tc/tc.c b/tc/tc.c +index 0d223281ba25e..62d54186ec667 100644 +--- a/tc/tc.c ++++ b/tc/tc.c +@@ -331,6 +331,7 @@ static int batch(const char *name) + int batchsize = 0; + size_t len = 0; + int ret = 0; ++ int err; + bool send; + + batch_mode = 1; +@@ -399,9 +400,9 @@ static int batch(const char *name) + continue; /* blank line */ + } + +- ret = do_cmd(largc, largv, tail == NULL ? NULL : tail->buf, ++ err = do_cmd(largc, largv, tail == NULL ? NULL : tail->buf, + tail == NULL ? 0 : sizeof(tail->buf)); +- if (ret != 0) { ++ if (err != 0) { + fprintf(stderr, "Command failed %s:%d\n", name, + cmdlineno - 1); + ret = 1; +@@ -423,15 +424,17 @@ static int batch(const char *name) + iov->iov_len = n->nlmsg_len; + } + +- ret = rtnl_talk_iov(&rth, iovs, batchsize, NULL); +- if (ret < 0) { ++ err = rtnl_talk_iov(&rth, iovs, batchsize, NULL); ++ put_batch_bufs(&buf_pool, &head, &tail); ++ free(iovs); ++ if (err < 0) { + fprintf(stderr, "Command failed %s:%d\n", name, +- cmdlineno - (batchsize + ret) - 1); +- return 2; ++ cmdlineno - (batchsize + err) - 1); ++ ret = 1; ++ if (!force) ++ break; + } +- put_batch_bufs(&buf_pool, &head, &tail); + batchsize = 0; +- free(iovs); + } + } while (!lastline); + +-- +2.18.0 + diff --git a/0002-tc-flower-use-correct-type-when-calling-flower_icmp_.patch b/0002-tc-flower-use-correct-type-when-calling-flower_icmp_.patch deleted file mode 100644 index 1ca3e04..0000000 --- a/0002-tc-flower-use-correct-type-when-calling-flower_icmp_.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 2706951bc0dad80596f172e9197452163bc9e067 Mon Sep 17 00:00:00 2001 -From: Simon Horman -Date: Wed, 8 Feb 2017 13:04:31 +0100 -Subject: [PATCH] tc: flower: use correct type when calling - flower_icmp_attr_type - -Use enum flower_icmp_field rather than bool as type of third parameter -when calling flower_icmp_attr_type. - -Fixes: eb3b5696f163 ("tc: flower: support matching on ICMP type and code") -Signed-off-by: Simon Horman -(cherry picked from commit 81f6e5a7279eaab826ba8b291b98fb2e89df0572) ---- - tc/f_flower.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/tc/f_flower.c b/tc/f_flower.c -index 145a8566..75a3fbbc 100644 ---- a/tc/f_flower.c -+++ b/tc/f_flower.c -@@ -752,10 +752,12 @@ static int flower_print_opt(struct filter_util *qu, FILE *f, - if (nl_type >= 0) - flower_print_port(f, "src_port", tb[nl_type]); - -- nl_type = flower_icmp_attr_type(eth_type, ip_proto, false); -+ nl_type = flower_icmp_attr_type(eth_type, ip_proto, -+ FLOWER_ICMP_FIELD_TYPE); - if (nl_type >= 0) - flower_print_icmp(f, "icmp_type", tb[nl_type]); -- nl_type = flower_icmp_attr_type(eth_type, ip_proto, true); -+ nl_type = flower_icmp_attr_type(eth_type, ip_proto, -+ FLOWER_ICMP_FIELD_CODE); - if (nl_type >= 0) - flower_print_icmp(f, "icmp_code", tb[nl_type]); - --- -2.11.0 - diff --git a/0003-bpf-test-for-valid-type-in-bpf_get_work_dir.patch b/0003-bpf-test-for-valid-type-in-bpf_get_work_dir.patch deleted file mode 100644 index 6b40d60..0000000 --- a/0003-bpf-test-for-valid-type-in-bpf_get_work_dir.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 305197a2378ffb581f1eca3ec804f76690be7b5a Mon Sep 17 00:00:00 2001 -From: Daniel Borkmann -Date: Mon, 6 Mar 2017 13:06:00 +0100 -Subject: [PATCH] bpf: test for valid type in bpf_get_work_dir - -Jan-Erik reported an assertion in bpf_prog_to_subdir() failed where -type was BPF_PROG_TYPE_UNSPEC, which is only used in bpf_init_env() -to auto-mount and cache the bpf fs mount point. - -Therefore, make sure when bpf_init_env() is called multiple times -(f.e. eBPF classifier with eBPF action attached) and bpf_mnt_cached -is set already that the type is also valid. In bpf_init_env(), we're -only interested in the mount point and not a type-specific subdir. - -Fixes: e42256699cac ("bpf: make tc's bpf loader generic and move into lib") -Reported-by: Jan-Erik Rediger -Signed-off-by: Daniel Borkmann -(cherry picked from commit 51361a9f1cfca81259c68515cb24fbaace03136a) ---- - lib/bpf.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/bpf.c b/lib/bpf.c -index 64e199b3..fef9cfcd 100644 ---- a/lib/bpf.c -+++ b/lib/bpf.c -@@ -596,7 +596,7 @@ static const char *bpf_get_work_dir(enum bpf_prog_type type) - if (bpf_mnt_cached) { - const char *out = mnt; - -- if (out) { -+ if (out && type) { - snprintf(bpf_tmp, sizeof(bpf_tmp), "%s%s/", - out, bpf_prog_to_subdir(type)); - out = bpf_tmp; --- -2.11.0 - diff --git a/0003-tc-Fix-output-of-ip-attributes.patch b/0003-tc-Fix-output-of-ip-attributes.patch new file mode 100644 index 0000000..c2ca53a --- /dev/null +++ b/0003-tc-Fix-output-of-ip-attributes.patch @@ -0,0 +1,34 @@ +From bf37f2caa14d86b6ac552a613428f5054d0eb835 Mon Sep 17 00:00:00 2001 +From: Roi Dayan +Date: Tue, 3 Jul 2018 15:54:32 +0300 +Subject: [PATCH] tc: Fix output of ip attributes + +Example output is of tos and ttl. +Befoe this fix the format used %x caused output of the pointer +instead of the intended string created in the out variable. + +Fixes: e28b88a464c4 ("tc: jsonify flower filter") +Signed-off-by: Roi Dayan +Signed-off-by: Stephen Hemminger +(cherry picked from commit 425dcc2741fa65d338f24de0606eb5c724658455) +Signed-off-by: Phil Sutter +--- + tc/f_flower.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tc/f_flower.c b/tc/f_flower.c +index ba8eb66cdd111..1eb3d01124ea8 100644 +--- a/tc/f_flower.c ++++ b/tc/f_flower.c +@@ -1132,7 +1132,7 @@ static void flower_print_ip_attr(char *name, struct rtattr *key_attr, + if (mask_attr) + sprintf(out + done, "/%x", rta_getattr_u8(mask_attr)); + +- sprintf(namefrm, "\n %s %%x", name); ++ sprintf(namefrm, "\n %s %%s", name); + print_string(PRINT_ANY, name, namefrm, out); + } + +-- +2.18.0 + diff --git a/0004-tc-don-t-double-print-rate.patch b/0004-tc-don-t-double-print-rate.patch new file mode 100644 index 0000000..9b28834 --- /dev/null +++ b/0004-tc-don-t-double-print-rate.patch @@ -0,0 +1,32 @@ +From 137837d8240482be4594fc6419a0d998e83c940b Mon Sep 17 00:00:00 2001 +From: Stephen Hemminger +Date: Mon, 9 Jul 2018 09:53:45 -0700 +Subject: [PATCH] tc: don't double print rate + +Conversion to print stats in JSON forgot to remove existing +fprintf. + +Fixes: 4fcec7f3665b ("tc: jsonify stats2") +Signed-off-by: Stephen Hemminger +(cherry picked from commit b49759c0e7c11cef57274b1023ec01c47da69c6c) +Signed-off-by: Phil Sutter +--- + tc/tc_util.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/tc/tc_util.c b/tc/tc_util.c +index e0c96291ade02..d7578528a31b1 100644 +--- a/tc/tc_util.c ++++ b/tc/tc_util.c +@@ -842,8 +842,6 @@ void print_tcstats2_attr(FILE *fp, struct rtattr *rta, char *prefix, struct rtat + + memcpy(&re, RTA_DATA(tbs[TCA_STATS_RATE_EST]), + MIN(RTA_PAYLOAD(tbs[TCA_STATS_RATE_EST]), sizeof(re))); +- fprintf(fp, "\n%srate %s %upps ", +- prefix, sprint_rate(re.bps, b1), re.pps); + print_string(PRINT_FP, NULL, "\n%s", prefix); + print_uint(PRINT_JSON, "rate", NULL, re.bps); + print_string(PRINT_FP, NULL, "rate %s", +-- +2.18.0 + diff --git a/0005-ipaddress-Fix-and-make-consistent-label-match-handli.patch b/0005-ipaddress-Fix-and-make-consistent-label-match-handli.patch new file mode 100644 index 0000000..724919b --- /dev/null +++ b/0005-ipaddress-Fix-and-make-consistent-label-match-handli.patch @@ -0,0 +1,132 @@ +From aed0c4bea2f947f318969ad4a2f42dfba7a426f4 Mon Sep 17 00:00:00 2001 +From: Serhey Popovych +Date: Sun, 15 Jul 2018 00:36:34 +0300 +Subject: [PATCH] ipaddress: Fix and make consistent label match handling + +Since commit 9516823051ce ("ipaddress: Improve print_linkinfo()") we +return -1 instead of 0 when ip-address(8) label does not match network +device name as we did before change. This causes regression when trying +to output ip address matching label: + + # ip addr add 192.168.192.1/24 dev lo label lo:1 + # ip addr show label lo:1 + + +This is special case and return 0 from print_linkinfo() earlier to match +only filter.ifindex and filter.up if given, but not rest fields in +@filter. Then call print_selected_addrinfo() without calling +print_link_stats() in ipaddr_list_flush_or_save(). + +Later print_selected_addrinfo() calls print_addrinfo() that finally +matches IFA_LABEL attribute in netlink buffer with filter.label using +ifa_label_match_rta(). + +On the other hand there is three conditions checked in print_linkinfo() +to determine label special case: + + 1) filter.label != NULL + 2) filter.family == AF_UNSPEC || filter.family == AF_PACKET + 3) fnmatch(filter.label, name, 0) + +With 1) it is ok to check if filtering by label is on by given pattern +in @filter.label. + +Since label is IPv4 specific and AF_PACKET is for printing ip-link(8) +information (see ipaddr_link_list()::ipaddress.c as example) checking +for AF_PACKET in 2) doesn't take much sense: better to defer these +checks to print_addrinfo() determine valid combinations before calling +ifa_label_match_rta() to finally match IFA_LABEL to pattern in +filter.label. + +For 3) we have following call for test case: + + fnmatch(pattern, string, flags) -> + fnmatch(filter.label, name, 0) -> + fnmatch("lo:1", "lo", 0) == FNM_NOMATCH (1) or non-zero on error + +To support special case in print_linkinfo() for filtering by label we +only need to check if label pattern is given in filter.label and return +0 to skip print_link_stats() in ipaddr_list_flush_or_save(): actual +filtering will be done in print_addrinfo(). + +Before commit 9516823051ce ("ipaddress: Improve print_linkinfo()"): +------------------------------------------------------------------- + +$ ip addr sh label lo +1: lo: mtu 65536 qdisc noqueue state UNKNOWN \ +group default qlen 1000 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + fnmatch("lo", "lo", 0) == 0 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever + inet6 ::1/128 scope host + valid_lft forever preferred_lft forever +$ ip addr show label 'lo:*' + inet 192.168.192.1/24 scope global lo:1 + valid_lft forever preferred_lft forever +$ ip addr sh label lo:1 + inet 192.168.192.1/24 scope global lo:1 + valid_lft forever preferred_lft forever +$ ip -4 addr sh label lo:1 +1: lo: mtu 65536 qdisc noqueue state UNKNOWN \ +group default qlen 1000 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + filter.family == AF_INET + inet 192.168.192.1/24 scope global lo:1 + valid_lft forever preferred_lft forever + +After this change applied: +-------------------------- + +$ ip/ip addr show label lo + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever + inet6 ::1/128 scope host + valid_lft forever preferred_lft forever +$ ip/ip addr show label 'lo:*' + inet 192.168.192.1/24 scope global lo:1 + valid_lft forever preferred_lft forever +$ ip/ip addr show label lo:1 + inet 192.168.192.1/24 scope global lo:1 + valid_lft forever preferred_lft forever +$ ip/ip -4 addr show label lo:1 + inet 192.168.192.1/24 scope global lo:1 + valid_lft forever preferred_lft forever + +Note that we no longer show link information as we did previously: + we are filtering by "label" pattern, not showing by "dev". + +Fixes: commit 9516823051ce ("ipaddress: Improve print_linkinfo()") +Reported-by: Vincent Bernat +Signed-off-by: Serhey Popovych + +Signed-off-by: Stephen Hemminger + +(cherry picked from commit 8df708afd62e4c3f7c79108d59f1ffa90123e9be) + +Signed-off-by: Phil Sutter +--- + ip/ipaddress.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/ip/ipaddress.c b/ip/ipaddress.c +index e4a1b985e4e9d..e07c08342665e 100644 +--- a/ip/ipaddress.c ++++ b/ip/ipaddress.c +@@ -837,10 +837,8 @@ int print_linkinfo(const struct sockaddr_nl *who, + if (!name) + return -1; + +- if (filter.label && +- (!filter.family || filter.family == AF_PACKET) && +- fnmatch(filter.label, name, 0)) +- return -1; ++ if (filter.label) ++ return 0; + + if (tb[IFLA_GROUP]) { + int group = rta_getattr_u32(tb[IFLA_GROUP]); +-- +2.18.0 + diff --git a/0006-tc-Do-not-use-addattr_nest_compat-on-mqprio-and-nete.patch b/0006-tc-Do-not-use-addattr_nest_compat-on-mqprio-and-nete.patch new file mode 100644 index 0000000..fccff51 --- /dev/null +++ b/0006-tc-Do-not-use-addattr_nest_compat-on-mqprio-and-nete.patch @@ -0,0 +1,122 @@ +From c9008ffda65cdc282c5bff43633ca8b4812b9ade Mon Sep 17 00:00:00 2001 +From: Jesus Sanchez-Palencia +Date: Mon, 16 Jul 2018 10:52:18 -0700 +Subject: [PATCH] tc: Do not use addattr_nest_compat on mqprio and netem + +Here we are partially reverting commit c14f9d92eee107 +"treewide: Use addattr_nest()/addattr_nest_end() to handle nested +attributes" . + +As discussed in [1], changing from the 'manually' coded version that +used addattr_l() to addattr_nest_compat() wasn't functionally +equivalent, because now the messages have extra fields appended to it. + +This introduced a regression since the implementation of parse_attr() +from both mqprio and netem can't handle this new message format. + +Without this fix, mqprio returns an error. netem won't return an error +but its internal configuration ends up wrong. + +As an example, this can be reproduced by the following commands when +this patch is not applied: + + 1) mqprio +$ tc qdisc replace dev enp3s0 parent root handle 100 mqprio \ + num_tc 3 map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \ + queues 1@0 1@1 2@2 hw 0 + +RTNETLINK answers: Numerical result out of range + + 2) netem +$ tc qdisc add dev enp3s0 root netem rate 5kbit 20 100 5 \ + distribution normal latency 1 1 + +$ tc -s qdisc + +(...) +qdisc netem 8001: dev enp3s0 root refcnt 9 limit 1000 delay 0us 0us + Sent 402 bytes 1 pkt (dropped 0, overlimits 0 requeues 0) + backlog 0b 0p requeues 0 +(...) + +With this patch applied, the tc -s qdisc command above for netem instead +reads: + +(...) +qdisc netem 8002: dev enp3s0 root refcnt 9 limit 1000 delay 0us 0us \ + rate 5Kbit packetoverhead 20 cellsize 100 celloverhead 5 + Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) + backlog 0b 0p requeues 0 +(...) + +[1] https://patchwork.ozlabs.org/patch/867860/#1893405 + +Fixes: c14f9d92eee107 ("treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes") +Reported-by: Vinicius Costa Gomes +Signed-off-by: Jesus Sanchez-Palencia +Signed-off-by: Stephen Hemminger +(cherry picked from commit b625e3610893fb75cd7199e2752fd488e042dc6b) +Signed-off-by: Phil Sutter +--- + tc/q_mqprio.c | 5 +++-- + tc/q_netem.c | 7 +++++-- + 2 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/tc/q_mqprio.c b/tc/q_mqprio.c +index 207d6441d8fa3..89b460020e27e 100644 +--- a/tc/q_mqprio.c ++++ b/tc/q_mqprio.c +@@ -173,7 +173,8 @@ static int mqprio_parse_opt(struct qdisc_util *qu, int argc, + argc--; argv++; + } + +- tail = addattr_nest_compat(n, 1024, TCA_OPTIONS, &opt, sizeof(opt)); ++ tail = NLMSG_TAIL(n); ++ addattr_l(n, 1024, TCA_OPTIONS, &opt, sizeof(opt)); + + if (flags & TC_MQPRIO_F_MODE) + addattr_l(n, 1024, TCA_MQPRIO_MODE, +@@ -208,7 +209,7 @@ static int mqprio_parse_opt(struct qdisc_util *qu, int argc, + addattr_nest_end(n, start); + } + +- addattr_nest_compat_end(n, tail); ++ tail->rta_len = (void *)NLMSG_TAIL(n) - (void *)tail; + + return 0; + } +diff --git a/tc/q_netem.c b/tc/q_netem.c +index 623ec9038ad37..9f9a9b3df255f 100644 +--- a/tc/q_netem.c ++++ b/tc/q_netem.c +@@ -422,6 +422,8 @@ static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv, + } + } + ++ tail = NLMSG_TAIL(n); ++ + if (reorder.probability) { + if (opt.latency == 0) { + fprintf(stderr, "reordering not possible without specifying some delay\n"); +@@ -450,7 +452,8 @@ static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv, + return -1; + } + +- tail = addattr_nest_compat(n, 1024, TCA_OPTIONS, &opt, sizeof(opt)); ++ if (addattr_l(n, 1024, TCA_OPTIONS, &opt, sizeof(opt)) < 0) ++ return -1; + + if (present[TCA_NETEM_CORR] && + addattr_l(n, 1024, TCA_NETEM_CORR, &cor, sizeof(cor)) < 0) +@@ -509,7 +512,7 @@ static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv, + return -1; + free(dist_data); + } +- addattr_nest_compat_end(n, tail); ++ tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail; + return 0; + } + +-- +2.18.0 + diff --git a/0007-devlink-CTRL_ATTR_FAMILY_ID-is-a-u16.patch b/0007-devlink-CTRL_ATTR_FAMILY_ID-is-a-u16.patch new file mode 100644 index 0000000..7761cb6 --- /dev/null +++ b/0007-devlink-CTRL_ATTR_FAMILY_ID-is-a-u16.patch @@ -0,0 +1,32 @@ +From ef6d9160c9066ce2e35cbf7ef94e37b4f02f1fc9 Mon Sep 17 00:00:00 2001 +From: David Ahern +Date: Fri, 20 Jul 2018 09:35:26 -0700 +Subject: [PATCH] devlink: CTRL_ATTR_FAMILY_ID is a u16 + +CTRL_ATTR_FAMILY_ID is a u16, not a u32. Update devlink accordingly. + +Fixes: a3c4b484a1edd ("add devlink tool") +Signed-off-by: David Ahern +Signed-off-by: Stephen Hemminger +(cherry picked from commit 7f57c8b726398835cb3f83f5bef02e3c2853d593) +Signed-off-by: Phil Sutter +--- + devlink/mnlg.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/devlink/mnlg.c b/devlink/mnlg.c +index c33c90be44149..37cc25ddf4909 100644 +--- a/devlink/mnlg.c ++++ b/devlink/mnlg.c +@@ -199,7 +199,7 @@ int mnlg_socket_group_add(struct mnlg_socket *nlg, const char *group_name) + + nlh = __mnlg_msg_prepare(nlg, CTRL_CMD_GETFAMILY, + NLM_F_REQUEST | NLM_F_ACK, GENL_ID_CTRL, 1); +- mnl_attr_put_u32(nlh, CTRL_ATTR_FAMILY_ID, nlg->id); ++ mnl_attr_put_u16(nlh, CTRL_ATTR_FAMILY_ID, nlg->id); + + err = mnlg_socket_send(nlg, nlh); + if (err < 0) +-- +2.18.0 + diff --git a/iproute.spec b/iproute.spec index eb0ca8e..e5ec1a8 100644 --- a/iproute.spec +++ b/iproute.spec @@ -1,8 +1,8 @@ %global cbq_version v0.7.3 Summary: Advanced IP routing and network device configuration tools Name: iproute -Version: 4.12.0 -Release: 3%{?dist} +Version: 4.17.0 +Release: 1%{?dist} Group: Applications/System URL: http://kernel.org/pub/linux/utils/net/%{name}2/ Source0: http://kernel.org/pub/linux/utils/net/%{name}2/%{name}2-%{version}.tar.xz @@ -12,9 +12,15 @@ Source2: avpkt # Fedora local docs changes: # - We ship cbq.init-v0.7.3 as cbq binary, so have a cbq.8 man page which links # to tc-cbq.8. -# - Drop reference to Debian from ss.8 man page. -# - We ship ss.ps instead of ss.html. -Patch1: 0001-Documentation-fixes.patch +Patch1: 0001-Add-cbq.8-as-an-alias-to-tc-cbq.8.patch + +# Upstream-suggested fixes +Patch2: 0002-tc-fix-batch-force-option.patch +Patch3: 0003-tc-Fix-output-of-ip-attributes.patch +Patch4: 0004-tc-don-t-double-print-rate.patch +Patch5: 0005-ipaddress-Fix-and-make-consistent-label-match-handli.patch +Patch6: 0006-tc-Do-not-use-addattr_nest_compat-on-mqprio-and-nete.patch +Patch7: 0007-devlink-CTRL_ATTR_FAMILY_ID-is-a-u16.patch License: GPLv2+ and Public Domain BuildRequires: bison @@ -26,13 +32,6 @@ BuildRequires: libmnl-devel BuildRequires: libselinux-devel BuildRequires: pkgconfig %if ! 0%{?_module_build} -BuildRequires: linuxdoc-tools -BuildRequires: psutils -BuildRequires: tex(cm-super-t1.enc) -BuildRequires: tex(dvips) -BuildRequires: tex(ecrm1000.tfm) -BuildRequires: tex(latex) -BuildRequires: tex(fullpage.sty) %if 0%{?fedora} BuildRequires: linux-atm-libs-devel %endif @@ -81,8 +80,7 @@ Provides: iproute-static = %{version}-%{release} The libnetlink static library. %prep -%setup -q -n %{name}2-%{version} -%patch1 -p1 +%autosetup -p1 -n %{name}2-%{version} %build export CFLAGS="%{optflags}" @@ -90,9 +88,6 @@ export LIBDIR=/%{_libdir} export IPT_LIB_DIR=/%{_lib}/xtables ./configure make %{?_smp_mflags} -%if ! 0%{?_module_build} -make -C doc -%endif %install export DESTDIR='%{buildroot}' @@ -158,7 +153,6 @@ rm -rf '%{buildroot}%{_docdir}' %files doc %{!?_licensedir:%global license %%doc} %license COPYING -%doc doc/*.ps %doc examples %endif @@ -171,6 +165,31 @@ rm -rf '%{buildroot}%{_docdir}' %{_includedir}/iproute2/bpf_elf.h %changelog +* 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 + +* Tue Feb 13 2018 Phil Sutter - 4.15.0-1 +- New version 4.15.0 + +* 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 diff --git a/sources b/sources index 60df61a..f6cd723 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (iproute2-4.12.0.tar.xz) = 275147f71e7c4698654f0d6d0981ab42f6f108066508c15cfcd5d9e0d3aaf8d33291968d9f06cb03f5494d801cfabf8d53308aaf56fc4fa92c52b137e970a3b0 +SHA512 (iproute2-4.17.0.tar.xz) = ccd7fb70afd58f1fcd4e17c38a24607207da853c4d6118fda423efa6e51faad3ad03c4d6d58a579c40ef9c68aaf13b1c455e12b0c36e155712d3d4db3c2ff4b5