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 diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h index ab09b3b8..d904cdd7 100644 --- a/include/uapi/linux/devlink.h +++ b/include/uapi/linux/devlink.h @@ -421,6 +421,8 @@ enum devlink_attr { DEVLINK_ATTR_RELOAD_FAILED, /* u8 0 or 1 */ + DEVLINK_ATTR_HEALTH_REPORTER_DUMP_TS_NS, /* u64 */ + DEVLINK_ATTR_NETNS_FD, /* u32 */ DEVLINK_ATTR_NETNS_PID, /* u32 */ DEVLINK_ATTR_NETNS_ID, /* u32 */ diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in index 9629a649..939e2ad4 100644 --- a/man/man8/ip-link.8.in +++ b/man/man8/ip-link.8.in @@ -1921,7 +1921,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 diff --git a/man/man8/tc-ematch.8 b/man/man8/tc-ematch.8 index 042f8404..3df870f0 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 @@ -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 diff --git a/misc/ss.c b/misc/ss.c index f2a64941..c58e5c4d 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -134,6 +134,7 @@ enum col_id { COL_RADDR, COL_RSERV, COL_EXT, + COL_PROC, COL_MAX }; @@ -161,6 +162,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 }, }; diff --git a/tc/f_flower.c b/tc/f_flower.c index a2a23016..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, @@ -1847,13 +1834,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, true); } 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, true); } 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 0eb53040..393721e3 100644 --- a/tc/tc_util.c +++ b/tc/tc_util.c @@ -915,46 +915,73 @@ compat_xstats: *xstats = tb[TCA_XSTATS]; } -void print_masked_u32(const char *name, struct rtattr *attr, - struct rtattr *mask_attr) +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, bool newline) { - __u32 value, mask; SPRINT_BUF(namefrm); + __u32 value, mask; SPRINT_BUF(out); size_t done; if (!attr) return; - value = rta_getattr_u32(attr); - mask = mask_attr ? rta_getattr_u32(mask_attr) : UINT32_MAX; + value = rta_getattr_type(attr); + mask = mask_attr ? rta_getattr_type(mask_attr) : type_max; - done = sprintf(out, "%u", value); - if (mask != UINT32_MAX) - sprintf(out + done, "/0x%x", mask); + 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(namefrm, " %s %%s", name); - print_string(PRINT_ANY, name, namefrm, out); + sprintf(mask_name, "%s_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); + 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, bool newline) +{ + print_masked_type(UINT32_MAX, rta_getattr_u32, name, attr, mask_attr, + newline); +} + +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) + 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", 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) +{ + return rta_getattr_u8(attr); +} + +void print_masked_u8(const char *name, struct rtattr *attr, + struct rtattr *mask_attr, bool newline) +{ + print_masked_type(UINT8_MAX, __rta_getattr_u8_u32, name, attr, + mask_attr, newline); } diff --git a/tc/tc_util.h b/tc/tc_util.h index 0c3425ab..9adf2ab4 100644 --- a/tc/tc_util.h +++ b/tc/tc_util.h @@ -128,7 +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, bool newline); #endif