Merge branch 'master' into next

Conflicts:
	include/uapi/linux/devlink.h

Signed-off-by: David Ahern <dsahern@gmail.com>
This commit is contained in:
David Ahern 2019-11-20 02:31:01 +00:00
commit 536dcd2016
11 changed files with 86 additions and 53 deletions

View File

@ -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
*

View File

@ -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
*

View File

@ -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

View File

@ -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 */

View File

@ -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

View File

@ -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

View File

@ -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 },
};

View File

@ -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)

View File

@ -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);

View File

@ -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);
}

View File

@ -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