From 130f549604a871933d7d52e30bae5958de188dcb Mon Sep 17 00:00:00 2001 From: Guillaume Nault Date: Fri, 8 Nov 2019 22:28:04 +0100 Subject: [PATCH 01/11] man: remove ppp from list of devices not allowed to change netns PPP devices can be moved to different network namespaces. The feature was added by commit 79c441ae505c ("ppp: implement x-netns support") in Linux 4.3. Signed-off-by: Guillaume Nault Signed-off-by: Stephen Hemminger --- man/man8/ip-link.8.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in index 31051c52..d1db0e97 100644 --- a/man/man8/ip-link.8.in +++ b/man/man8/ip-link.8.in @@ -1910,7 +1910,7 @@ move the device to the network namespace associated with name .RI process " PID". Some devices are not allowed to change network namespace: loopback, bridge, -ppp, wireless. These are network namespace local devices. In such case +wireless. These are network namespace local devices. In such case .B ip tool will return "Invalid argument" error. It is possible to find out if device is local to a single network namespace by checking From 5883c6eba5173745eeb4e5467c59dd34d415bd7e Mon Sep 17 00:00:00 2001 From: Hritik Vijay Date: Wed, 13 Nov 2019 03:57:02 +0530 Subject: [PATCH 02/11] ss: show header for --processes/-p ss by default shows headers for every column but omits it for --processes for no apparent reason. This patch adds the "Process" header. Signed-off-by: Hritik Vijay Signed-off-by: Stephen Hemminger --- misc/ss.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misc/ss.c b/misc/ss.c index efa87781..794c1895 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -133,6 +133,7 @@ enum col_id { COL_RADDR, COL_RSERV, COL_EXT, + COL_PROC, COL_MAX }; @@ -160,6 +161,7 @@ static struct column columns[] = { { ALIGN_LEFT, "Port", "", 0, 0, 0 }, { ALIGN_RIGHT, "Peer Address:", " ", 0, 0, 0 }, { ALIGN_LEFT, "Port", "", 0, 0, 0 }, + { ALIGN_LEFT, "Process", "", 0, 0, 0 }, { ALIGN_LEFT, "", "", 0, 0, 0 }, }; From d24f5ae3f2dc2fe70030ee368ae6627aebd268db Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 14 Nov 2019 09:24:10 -0800 Subject: [PATCH 03/11] uapi: SPDX license updates Upstream changes to SPDX licenses in headers. Signed-off-by: Stephen Hemminger --- include/uapi/linux/can.h | 2 +- include/uapi/linux/can/netlink.h | 2 +- include/uapi/linux/can/vxcan.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/uapi/linux/can.h b/include/uapi/linux/can.h index c61cdc7a..55b66607 100644 --- a/include/uapi/linux/can.h +++ b/include/uapi/linux/can.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */ +/* SPDX-License-Identifier: ((GPL-2.0-only WITH Linux-syscall-note) OR BSD-3-Clause) */ /* * linux/can.h * diff --git a/include/uapi/linux/can/netlink.h b/include/uapi/linux/can/netlink.h index c1f62640..7159dc67 100644 --- a/include/uapi/linux/can/netlink.h +++ b/include/uapi/linux/can/netlink.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ /* * linux/can/netlink.h * diff --git a/include/uapi/linux/can/vxcan.h b/include/uapi/linux/can/vxcan.h index b364d775..3e3d2eb4 100644 --- a/include/uapi/linux/can/vxcan.h +++ b/include/uapi/linux/can/vxcan.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ #ifndef _CAN_VXCAN_H #define _CAN_VXCAN_H From 5d5c3947266547d89483146ea52f5903e3a433f5 Mon Sep 17 00:00:00 2001 From: Roman Mashak Date: Thu, 14 Nov 2019 13:22:35 -0500 Subject: [PATCH 04/11] man: tc-ematch.8: update list of filter using extended matches Extended match rules are currently supported by basic, flow and cgroup filters, so update the man page. Signed-off-by: Roman Mashak Signed-off-by: Stephen Hemminger --- man/man8/tc-ematch.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/man8/tc-ematch.8 b/man/man8/tc-ematch.8 index 042f8404..4c97044a 100644 --- a/man/man8/tc-ematch.8 +++ b/man/man8/tc-ematch.8 @@ -1,7 +1,7 @@ .TH ematch 8 "6 August 2012" iproute2 Linux . .SH NAME -ematch \- extended matches for use with "basic" or "flow" filters +ematch \- extended matches for use with "basic", "cgroup" or "flow" filters . .SH SYNOPSIS .sp From cc08619c3c64c2a2705642cb89af177d6cb0fcfc Mon Sep 17 00:00:00 2001 From: Roman Mashak Date: Thu, 14 Nov 2019 13:22:36 -0500 Subject: [PATCH 05/11] man: tc-ematch.8: documented canid() ematch rule tc-ematch.8 was missing the description of canid() ematch rule, so document this. Signed-off-by: Roman Mashak Signed-off-by: Stephen Hemminger --- man/man8/tc-ematch.8 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/man/man8/tc-ematch.8 b/man/man8/tc-ematch.8 index 4c97044a..3df870f0 100644 --- a/man/man8/tc-ematch.8 +++ b/man/man8/tc-ematch.8 @@ -109,6 +109,19 @@ test packet against xtables matches The flag options are the same as those used by the xtable match used. +.SS canid +ematch rule to match CAN frames + +.IR canid "( " IDLIST " ) + +.IR IDLIST " := " IDSPEC [ IDLIST ] + +.IR IDSPEC " := { ’sff’ " CANID " | ’eff’ " CANID " } + +.IR CANID " := " ID [ ":MASK" ] + +.IR ID ", " MASK " := hexadecimal number (i.e. 0x123) + .SH CAVEATS The ematch syntax uses '(' and ')' to group expressions. All braces need to be From 04b215015ba8dd214d8dcabc8b958036845f5f5d Mon Sep 17 00:00:00 2001 From: Eli Britstein Date: Thu, 14 Nov 2019 14:44:37 +0200 Subject: [PATCH 06/11] tc_util: introduce a function to print JSON/non-JSON masked numbers Introduce a function to print masked number with a different output for JSON or non-JSON methods, as a pre-step towards printing numbers using this common function. Signed-off-by: Eli Britstein Reviewed-by: Roi Dayan Acked-by: Jiri Pirko Signed-off-by: Stephen Hemminger --- tc/tc_util.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ tc/tc_util.h | 2 ++ 2 files changed, 53 insertions(+) diff --git a/tc/tc_util.c b/tc/tc_util.c index 0eb53040..6bd098fe 100644 --- a/tc/tc_util.c +++ b/tc/tc_util.c @@ -915,6 +915,45 @@ compat_xstats: *xstats = tb[TCA_XSTATS]; } +static void print_masked_type(__u32 type_max, + __u32 (*rta_getattr_type)(const struct rtattr *), + const char *name, struct rtattr *attr, + struct rtattr *mask_attr) +{ + SPRINT_BUF(namefrm); + __u32 value, mask; + SPRINT_BUF(out); + size_t done; + + if (!attr) + return; + + value = rta_getattr_type(attr); + mask = mask_attr ? rta_getattr_type(mask_attr) : type_max; + + if (is_json_context()) { + sprintf(namefrm, "\n %s %%u", name); + print_hu(PRINT_ANY, name, namefrm, + rta_getattr_type(attr)); + if (mask != type_max) { + char mask_name[SPRINT_BSIZE-6]; + + sprintf(mask_name, "%s_mask", name); + print_string(PRINT_FP, NULL, "%s ", _SL_); + sprintf(namefrm, "%s %%u", mask_name); + print_hu(PRINT_ANY, mask_name, namefrm, mask); + } + } else { + done = sprintf(out, "%u", value); + if (mask != type_max) + sprintf(out + done, "/0x%x", mask); + + print_string(PRINT_FP, NULL, "%s ", _SL_); + sprintf(namefrm, "%s %%s", name); + print_string(PRINT_ANY, name, namefrm, out); + } +} + void print_masked_u32(const char *name, struct rtattr *attr, struct rtattr *mask_attr) { @@ -958,3 +997,15 @@ void print_masked_u16(const char *name, struct rtattr *attr, sprintf(namefrm, " %s %%s", name); print_string(PRINT_ANY, name, namefrm, out); } + +static __u32 __rta_getattr_u8_u32(const struct rtattr *attr) +{ + return rta_getattr_u8(attr); +} + +void print_masked_u8(const char *name, struct rtattr *attr, + struct rtattr *mask_attr) +{ + print_masked_type(UINT8_MAX, __rta_getattr_u8_u32, name, attr, + mask_attr); +} diff --git a/tc/tc_util.h b/tc/tc_util.h index 0c3425ab..7e5d93cb 100644 --- a/tc/tc_util.h +++ b/tc/tc_util.h @@ -131,4 +131,6 @@ void print_masked_u32(const char *name, struct rtattr *attr, struct rtattr *mask_attr); void print_masked_u16(const char *name, struct rtattr *attr, struct rtattr *mask_attr); +void print_masked_u8(const char *name, struct rtattr *attr, + struct rtattr *mask_attr); #endif From 746e6c0fd312ccb091c5ce6b639623aa7f0abfd3 Mon Sep 17 00:00:00 2001 From: Eli Britstein Date: Thu, 14 Nov 2019 14:44:38 +0200 Subject: [PATCH 07/11] tc_util: add an option to print masked numbers with/without a newline Add an option to print masked numbers with or without a newline, as a pre-step towards using a common function. Signed-off-by: Eli Britstein Reviewed-by: Roi Dayan Acked-by: Jiri Pirko Signed-off-by: Stephen Hemminger --- tc/f_flower.c | 4 ++-- tc/m_ct.c | 4 ++-- tc/tc_util.c | 25 +++++++++++++------------ tc/tc_util.h | 6 +++--- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/tc/f_flower.c b/tc/f_flower.c index a2a23016..41b81217 100644 --- a/tc/f_flower.c +++ b/tc/f_flower.c @@ -1847,13 +1847,13 @@ static void flower_print_ct_label(struct rtattr *attr, static void flower_print_ct_zone(struct rtattr *attr, struct rtattr *mask_attr) { - print_masked_u16("ct_zone", attr, mask_attr); + print_masked_u16("ct_zone", attr, mask_attr, false); } static void flower_print_ct_mark(struct rtattr *attr, struct rtattr *mask_attr) { - print_masked_u32("ct_mark", attr, mask_attr); + print_masked_u32("ct_mark", attr, mask_attr, false); } static void flower_print_key_id(const char *name, struct rtattr *attr) diff --git a/tc/m_ct.c b/tc/m_ct.c index d79eb5e3..8df2f610 100644 --- a/tc/m_ct.c +++ b/tc/m_ct.c @@ -466,8 +466,8 @@ static int print_ct(struct action_util *au, FILE *f, struct rtattr *arg) print_string(PRINT_ANY, "action", " %s", "clear"); } - print_masked_u32("mark", tb[TCA_CT_MARK], tb[TCA_CT_MARK_MASK]); - print_masked_u16("zone", tb[TCA_CT_ZONE], NULL); + print_masked_u32("mark", tb[TCA_CT_MARK], tb[TCA_CT_MARK_MASK], false); + print_masked_u16("zone", tb[TCA_CT_ZONE], NULL, false); ct_print_labels(tb[TCA_CT_LABELS], tb[TCA_CT_LABELS_MASK]); ct_print_nat(ct_action, tb); diff --git a/tc/tc_util.c b/tc/tc_util.c index 6bd098fe..e9f3e5a2 100644 --- a/tc/tc_util.c +++ b/tc/tc_util.c @@ -918,7 +918,7 @@ compat_xstats: static void print_masked_type(__u32 type_max, __u32 (*rta_getattr_type)(const struct rtattr *), const char *name, struct rtattr *attr, - struct rtattr *mask_attr) + struct rtattr *mask_attr, bool newline) { SPRINT_BUF(namefrm); __u32 value, mask; @@ -939,23 +939,24 @@ static void print_masked_type(__u32 type_max, char mask_name[SPRINT_BSIZE-6]; sprintf(mask_name, "%s_mask", name); - print_string(PRINT_FP, NULL, "%s ", _SL_); - sprintf(namefrm, "%s %%u", mask_name); + if (newline) + print_string(PRINT_FP, NULL, "%s ", _SL_); + sprintf(namefrm, " %s %%u", mask_name); print_hu(PRINT_ANY, mask_name, namefrm, mask); } } else { done = sprintf(out, "%u", value); if (mask != type_max) sprintf(out + done, "/0x%x", mask); - - print_string(PRINT_FP, NULL, "%s ", _SL_); - sprintf(namefrm, "%s %%s", name); + if (newline) + print_string(PRINT_FP, NULL, "%s ", _SL_); + sprintf(namefrm, " %s %%s", name); print_string(PRINT_ANY, name, namefrm, out); } } void print_masked_u32(const char *name, struct rtattr *attr, - struct rtattr *mask_attr) + struct rtattr *mask_attr, bool newline) { __u32 value, mask; SPRINT_BUF(namefrm); @@ -972,12 +973,12 @@ void print_masked_u32(const char *name, struct rtattr *attr, if (mask != UINT32_MAX) sprintf(out + done, "/0x%x", mask); - sprintf(namefrm, " %s %%s", name); + sprintf(namefrm, "%s %s %%s", newline ? "\n " : "", name); print_string(PRINT_ANY, name, namefrm, out); } void print_masked_u16(const char *name, struct rtattr *attr, - struct rtattr *mask_attr) + struct rtattr *mask_attr, bool newline) { __u16 value, mask; SPRINT_BUF(namefrm); @@ -994,7 +995,7 @@ void print_masked_u16(const char *name, struct rtattr *attr, if (mask != UINT16_MAX) sprintf(out + done, "/0x%x", mask); - sprintf(namefrm, " %s %%s", name); + sprintf(namefrm, "%s %s %%s", newline ? "\n " : "", name); print_string(PRINT_ANY, name, namefrm, out); } @@ -1004,8 +1005,8 @@ static __u32 __rta_getattr_u8_u32(const struct rtattr *attr) } void print_masked_u8(const char *name, struct rtattr *attr, - struct rtattr *mask_attr) + struct rtattr *mask_attr, bool newline) { print_masked_type(UINT8_MAX, __rta_getattr_u8_u32, name, attr, - mask_attr); + mask_attr, newline); } diff --git a/tc/tc_util.h b/tc/tc_util.h index 7e5d93cb..9adf2ab4 100644 --- a/tc/tc_util.h +++ b/tc/tc_util.h @@ -128,9 +128,9 @@ int action_a2n(char *arg, int *result, bool allow_num); bool tc_qdisc_block_exists(__u32 block_index); void print_masked_u32(const char *name, struct rtattr *attr, - struct rtattr *mask_attr); + struct rtattr *mask_attr, bool newline); void print_masked_u16(const char *name, struct rtattr *attr, - struct rtattr *mask_attr); + struct rtattr *mask_attr, bool newline); void print_masked_u8(const char *name, struct rtattr *attr, - struct rtattr *mask_attr); + struct rtattr *mask_attr, bool newline); #endif From 99d5ee8368cfe50ab70c1386d8b83d0cc7624a99 Mon Sep 17 00:00:00 2001 From: Eli Britstein Date: Thu, 14 Nov 2019 14:44:39 +0200 Subject: [PATCH 08/11] tc: flower: fix newline prints for ct-mark and ct-zone Matches of ct-mark and ct-zone were printed all in the same line. Fix that so each ct match is printed in a separate line. Example: $ tc qdisc add dev eth0 ingress $ tc filter add dev eth0 protocol ip parent ffff: prio 1 flower skip_hw \ ct_zone 5 ct_mark 6/0xf action ct commit zone 7 mark 8/0xf drop Before: $ tc -s filter show dev eth0 parent ffff: filter protocol ip pref 1 flower chain 0 filter protocol ip pref 1 flower chain 0 handle 0x1 eth_type ipv4 ct_zone 5 ct_mark 6/0xf skip_hw not_in_hw action order 1: ct commit mark 8/0xf zone 7 drop index 1 ref 1 bind 1 installed 31 sec used 31 sec Action statistics: Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 After: $ tc -s filter show dev eth0 parent ffff: filter protocol ip pref 1 flower chain 0 filter protocol ip pref 1 flower chain 0 handle 0x1 eth_type ipv4 ct_zone 5 ct_mark 6/0xf skip_hw not_in_hw action order 1: ct commit mark 8/0xf zone 7 drop index 1 ref 1 bind 1 installed 108 sec used 108 sec Action statistics: Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 Fixes: c8a494314c40 ("tc: Introduce tc ct action") Signed-off-by: Eli Britstein Reviewed-by: Roi Dayan Acked-by: Jiri Pirko Signed-off-by: Stephen Hemminger --- tc/f_flower.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tc/f_flower.c b/tc/f_flower.c index 41b81217..72457756 100644 --- a/tc/f_flower.c +++ b/tc/f_flower.c @@ -1847,13 +1847,13 @@ static void flower_print_ct_label(struct rtattr *attr, static void flower_print_ct_zone(struct rtattr *attr, struct rtattr *mask_attr) { - print_masked_u16("ct_zone", attr, mask_attr, false); + print_masked_u16("ct_zone", attr, mask_attr, true); } static void flower_print_ct_mark(struct rtattr *attr, struct rtattr *mask_attr) { - print_masked_u32("ct_mark", attr, mask_attr, false); + print_masked_u32("ct_mark", attr, mask_attr, true); } static void flower_print_key_id(const char *name, struct rtattr *attr) From bb3ee8b313f3bc70ba2ec7d69799cd54f7c82036 Mon Sep 17 00:00:00 2001 From: Eli Britstein Date: Thu, 14 Nov 2019 14:44:40 +0200 Subject: [PATCH 09/11] tc_util: fix JSON prints for ct-mark and ct-zone Fix the output of ct-mark and ct-zone (both for matches and actions) to be different in JSON/non-JSON mode. Example: $ tc qdisc add dev eth0 ingress $ tc filter add dev eth0 protocol ip parent ffff: prio 1 flower skip_hw \ ct_zone 5 ct_mark 6/0xf action ct commit zone 7 mark 8/0xf drop Non JSON format remains the same: $ tc filter show dev eth0 parent ffff: $ tc -s filter show dev ens1f0_0 parent ffff: filter protocol ip pref 1 flower chain 0 filter protocol ip pref 1 flower chain 0 handle 0x1 eth_type ipv4 ct_zone 5 ct_mark 6/0xf skip_hw not_in_hw action order 1: ct commit mark 8/0xf zone 7 drop index 1 ref 1 bind 1 installed 108 sec used 108 sec Action statistics: Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 JSON format is changed (partial output): $ tc -p -j filter show dev eth0 parent ffff: Before: "options": { "keys": { "ct_zone": "5", "ct_mark": "6/0xf" ... "actions": [ { "order": 1, "kind": "ct", "action": "commit", "mark": "8/0xf", "zone": "7", ... After: "options": { "keys": { "ct_zone": 5, "ct_mark": 6, "ct_mark_mask": 15 ... "actions": [ { "order": 1, "kind": "ct", "action": "commit", "mark": 8, "mark_mask": 15, "zone": 7, ... Fixes: c8a494314c40 ("tc: Introduce tc ct action") Signed-off-by: Eli Britstein Reviewed-by: Roi Dayan Acked-by: Jiri Pirko Signed-off-by: Stephen Hemminger --- tc/tc_util.c | 41 ++++++++--------------------------------- 1 file changed, 8 insertions(+), 33 deletions(-) diff --git a/tc/tc_util.c b/tc/tc_util.c index e9f3e5a2..393721e3 100644 --- a/tc/tc_util.c +++ b/tc/tc_util.c @@ -958,45 +958,20 @@ static void print_masked_type(__u32 type_max, void print_masked_u32(const char *name, struct rtattr *attr, struct rtattr *mask_attr, bool newline) { - __u32 value, mask; - SPRINT_BUF(namefrm); - SPRINT_BUF(out); - size_t done; + print_masked_type(UINT32_MAX, rta_getattr_u32, name, attr, mask_attr, + newline); +} - if (!attr) - return; - - value = rta_getattr_u32(attr); - mask = mask_attr ? rta_getattr_u32(mask_attr) : UINT32_MAX; - - done = sprintf(out, "%u", value); - if (mask != UINT32_MAX) - sprintf(out + done, "/0x%x", mask); - - sprintf(namefrm, "%s %s %%s", newline ? "\n " : "", name); - print_string(PRINT_ANY, name, namefrm, out); +static __u32 __rta_getattr_u16_u32(const struct rtattr *attr) +{ + return rta_getattr_u16(attr); } void print_masked_u16(const char *name, struct rtattr *attr, struct rtattr *mask_attr, bool newline) { - __u16 value, mask; - SPRINT_BUF(namefrm); - SPRINT_BUF(out); - size_t done; - - if (!attr) - return; - - value = rta_getattr_u16(attr); - mask = mask_attr ? rta_getattr_u16(mask_attr) : UINT16_MAX; - - done = sprintf(out, "%u", value); - if (mask != UINT16_MAX) - sprintf(out + done, "/0x%x", mask); - - sprintf(namefrm, "%s %s %%s", newline ? "\n " : "", name); - print_string(PRINT_ANY, name, namefrm, out); + print_masked_type(UINT16_MAX, __rta_getattr_u16_u32, name, attr, + mask_attr, newline); } static __u32 __rta_getattr_u8_u32(const struct rtattr *attr) From 9479ec1ed0ff6bccde8f3d0e5470597046bb650d Mon Sep 17 00:00:00 2001 From: Eli Britstein Date: Thu, 14 Nov 2019 14:44:41 +0200 Subject: [PATCH 10/11] tc: flower: fix output for ip tos and ttl Fix the output for ip tos and ttl to be numbers in JSON format. Example: $ tc qdisc add dev eth0 ingress $ tc filter add dev eth0 protocol ip parent ffff: prio 1 flower skip_hw \ ip_tos 5/0xf action drop Non JSON format remains the same: $ tc filter show dev eth0 parent ffff: filter protocol ip pref 1 flower chain 0 filter protocol ip pref 1 flower chain 0 handle 0x1 eth_type ipv4 ip_tos 5/0xf skip_hw not_in_hw action order 1: gact action drop random type none pass val 0 index 1 ref 1 bind 1 JSON format is changed (partial output): $ tc -p -j filter show dev eth0 parent ffff: Before: "options": { "keys": { "ip_tos": "0x5/f", ... After: "options": { "keys": { "ip_tos": 5, "ip_tos_mask": 15, ... Fixes: 6ea2c2b1cff6 ("tc: flower: add support for matching on ip tos and ttl") Signed-off-by: Eli Britstein Reviewed-by: Roi Dayan Acked-by: Jiri Pirko Signed-off-by: Stephen Hemminger --- tc/f_flower.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/tc/f_flower.c b/tc/f_flower.c index 72457756..1b518ef3 100644 --- a/tc/f_flower.c +++ b/tc/f_flower.c @@ -1617,20 +1617,7 @@ static void flower_print_ip_proto(__u8 *p_ip_proto, static void flower_print_ip_attr(const char *name, struct rtattr *key_attr, struct rtattr *mask_attr) { - SPRINT_BUF(namefrm); - SPRINT_BUF(out); - size_t done; - - if (!key_attr) - return; - - done = sprintf(out, "0x%x", rta_getattr_u8(key_attr)); - if (mask_attr) - sprintf(out + done, "/%x", rta_getattr_u8(mask_attr)); - - print_string(PRINT_FP, NULL, "%s ", _SL_); - sprintf(namefrm, "%s %%s", name); - print_string(PRINT_ANY, name, namefrm, out); + print_masked_u8(name, key_attr, mask_attr, true); } static void flower_print_matching_flags(char *name, From a7fa739d12777b3e10be1088848b9cc4099676ac Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 19 Nov 2019 11:38:17 -0800 Subject: [PATCH 11/11] uapi: devlink.h health timestamp Signed-off-by: Stephen Hemminger --- include/uapi/linux/devlink.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h index 79e1405d..84c0caf2 100644 --- a/include/uapi/linux/devlink.h +++ b/include/uapi/linux/devlink.h @@ -421,6 +421,7 @@ enum devlink_attr { DEVLINK_ATTR_RELOAD_FAILED, /* u8 0 or 1 */ + DEVLINK_ATTR_HEALTH_REPORTER_DUMP_TS_NS, /* u64 */ /* add new attributes above here, update the policy in devlink.c */ __DEVLINK_ATTR_MAX,