Skip to content

Commit 9a4f0ba

Browse files
committed
Merge branch 'master' into next
Signed-off-by: David Ahern <dsahern@gmail.com>
2 parents d7f2bcc + 0ee4d17 commit 9a4f0ba

File tree

10 files changed

+75
-32
lines changed

10 files changed

+75
-32
lines changed

bridge/mdb.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -133,21 +133,21 @@ static void print_mdb_entry(FILE *f, int ifindex, const struct br_mdb_entry *e,
133133

134134
open_json_object(NULL);
135135

136-
print_int(PRINT_ANY, "index", "%u: ", ifindex);
137-
print_color_string(PRINT_ANY, COLOR_IFNAME, "dev", "%s ", dev);
138-
print_string(PRINT_ANY, "port", " %s ",
136+
print_int(PRINT_JSON, "index", NULL, ifindex);
137+
print_color_string(PRINT_ANY, COLOR_IFNAME, "dev", "dev %s", dev);
138+
print_string(PRINT_ANY, "port", " port %s",
139139
ll_index_to_name(e->ifindex));
140140

141141
print_color_string(PRINT_ANY, ifa_family_color(af),
142-
"grp", " %s ",
142+
"grp", " grp %s",
143143
inet_ntop(af, src, abuf, sizeof(abuf)));
144144

145-
print_string(PRINT_ANY, "state", " %s ",
145+
print_string(PRINT_ANY, "state", " %s",
146146
(e->state & MDB_PERMANENT) ? "permanent" : "temp");
147147

148148
open_json_array(PRINT_JSON, "flags");
149149
if (e->flags & MDB_FLAGS_OFFLOAD)
150-
print_string(PRINT_ANY, NULL, "%s ", "offload");
150+
print_string(PRINT_ANY, NULL, " %s", "offload");
151151
close_json_array(PRINT_JSON, NULL);
152152

153153
if (e->vid)

devlink/devlink.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1523,7 +1523,7 @@ static void __pr_out_handle_start(struct dl *dl, struct nlattr **tb,
15231523
{
15241524
const char *bus_name = mnl_attr_get_str(tb[DEVLINK_ATTR_BUS_NAME]);
15251525
const char *dev_name = mnl_attr_get_str(tb[DEVLINK_ATTR_DEV_NAME]);
1526-
char buf[32];
1526+
char buf[64];
15271527

15281528
sprintf(buf, "%s/%s", bus_name, dev_name);
15291529

@@ -1616,7 +1616,7 @@ static void __pr_out_port_handle_start(struct dl *dl, const char *bus_name,
16161616
uint32_t port_index, bool try_nice,
16171617
bool array)
16181618
{
1619-
static char buf[32];
1619+
static char buf[64];
16201620
char *ifname = NULL;
16211621

16221622
if (dl->no_nice_names || !try_nice ||

ip/iplink.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,8 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req, char **type)
946946
else if (!strcmp(name, dev))
947947
name = dev;
948948

949-
if (dev && addr_len) {
949+
if (dev && addr_len &&
950+
!(req->n.nlmsg_flags & NLM_F_CREATE)) {
950951
int halen = nl_get_ll_addr_len(dev);
951952

952953
if (halen >= 0 && halen != addr_len) {

lib/ll_map.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static int ll_link_get(const char *name, int index)
177177
addattr_l(&req.n, sizeof(req), IFLA_IFNAME, name,
178178
strlen(name) + 1);
179179

180-
if (rtnl_talk(&rth, &req.n, &answer) < 0)
180+
if (rtnl_talk_suppress_rtnl_errmsg(&rth, &req.n, &answer) < 0)
181181
goto out;
182182

183183
/* add entry to cache */

man/man8/ip-link.8.in

+9-4
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,15 @@ ip-link \- network device configuration
154154
.br
155155
.RB "[ " addrgenmode " { " eui64 " | " none " | " stable_secret " | " random " } ]"
156156
.br
157-
.RB "[ " macaddr " { " flush " | { " add " | " del " } "
158-
.IR MACADDR " | set [ "
159-
.IR MACADDR " [ "
160-
.IR MACADDR " [ ... ] ] ] } ]"
157+
.RB "[ " macaddr
158+
.RI "[ " MACADDR " ]"
159+
.br
160+
.in +10
161+
.RB "[ { " flush " | " add " | " del " } "
162+
.IR MACADDR " ]"
163+
.br
164+
.RB "[ " set
165+
.IR MACADDR " ] ]"
161166
.br
162167

163168
.ti -8

man/man8/tc-skbedit.8

+10-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ skbedit - SKB editing action
1010
.B priority
1111
.IR PRIORITY " ] ["
1212
.B mark
13-
.IR MARK " ]"
13+
.IR MARK " ] ["
1414
.B ptype
15-
.IR PTYPE " ]"
15+
.IR PTYPE " ] ["
16+
.BR inheritdsfield " ]"
1617
.SH DESCRIPTION
1718
The
1819
.B skbedit
@@ -22,7 +23,7 @@ action, which in turn allows to change parts of the packet data itself.
2223

2324
The most unique feature of
2425
.B skbedit
25-
is it's ability to decide over which queue of an interface with multiple
26+
is its ability to decide over which queue of an interface with multiple
2627
transmit queues the packet is to be sent out. The number of available transmit
2728
queues is reflected by sysfs entries within
2829
.I /sys/class/net/<interface>/queues
@@ -61,6 +62,12 @@ needing to allow ingressing packets with the wrong MAC address but
6162
correct IP address.
6263
.I PTYPE
6364
is one of: host, otherhost, broadcast, multicast
65+
.TP
66+
.BI inheritdsfield
67+
Override the packet classification decision, and any value specified with
68+
.BR priority ", "
69+
using the information stored in the Differentiated Services Field of the
70+
IPv6/IPv4 header (RFC2474).
6471
.SH SEE ALSO
6572
.BR tc (8),
6673
.BR tc-pedit (8)

tc/f_flower.c

+36-12
Original file line numberDiff line numberDiff line change
@@ -493,23 +493,40 @@ static int flower_port_range_attr_type(__u8 ip_proto, enum flower_endpoint type,
493493
return 0;
494494
}
495495

496+
/* parse range args in format 10-20 */
497+
static int parse_range(char *str, __be16 *min, __be16 *max)
498+
{
499+
char *sep;
500+
501+
sep = strchr(str, '-');
502+
if (sep) {
503+
*sep = '\0';
504+
505+
if (get_be16(min, str, 10))
506+
return -1;
507+
508+
if (get_be16(max, sep + 1, 10))
509+
return -1;
510+
} else {
511+
if (get_be16(min, str, 10))
512+
return -1;
513+
}
514+
return 0;
515+
}
516+
496517
static int flower_parse_port(char *str, __u8 ip_proto,
497518
enum flower_endpoint endpoint,
498519
struct nlmsghdr *n)
499520
{
500-
__u16 min, max;
521+
__be16 min = 0;
522+
__be16 max = 0;
501523
int ret;
502524

503-
ret = sscanf(str, "%hu-%hu", &min, &max);
504-
505-
if (ret == 1) {
506-
int type;
525+
ret = parse_range(str, &min, &max);
526+
if (ret)
527+
return -1;
507528

508-
type = flower_port_attr_type(ip_proto, endpoint);
509-
if (type < 0)
510-
return -1;
511-
addattr16(n, MAX_MSG, type, htons(min));
512-
} else if (ret == 2) {
529+
if (min && max) {
513530
__be16 min_port_type, max_port_type;
514531

515532
if (max <= min) {
@@ -520,8 +537,15 @@ static int flower_parse_port(char *str, __u8 ip_proto,
520537
&min_port_type, &max_port_type))
521538
return -1;
522539

523-
addattr16(n, MAX_MSG, min_port_type, htons(min));
524-
addattr16(n, MAX_MSG, max_port_type, htons(max));
540+
addattr16(n, MAX_MSG, min_port_type, min);
541+
addattr16(n, MAX_MSG, max_port_type, max);
542+
} else if (min && !max) {
543+
int type;
544+
545+
type = flower_port_attr_type(ip_proto, endpoint);
546+
if (type < 0)
547+
return -1;
548+
addattr16(n, MAX_MSG, type, min);
525549
} else {
526550
return -1;
527551
}

tc/m_gact.c

+4
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ parse_gact(struct action_util *a, int *argc_p, char ***argv_p,
8888

8989
if (!matches(*argv, "gact"))
9090
NEXT_ARG_FWD();
91+
/* we're binding existing gact action to filter by index. */
92+
if (!matches(*argv, "index"))
93+
goto skip_args;
9194
if (parse_action_control(&argc, &argv, &p.action, false))
9295
usage(); /* does not return */
9396

@@ -132,6 +135,7 @@ parse_gact(struct action_util *a, int *argc_p, char ***argv_p,
132135

133136
if (argc > 0) {
134137
if (matches(*argv, "index") == 0) {
138+
skip_args:
135139
NEXT_ARG();
136140
if (get_u32(&p.index, *argv, 10)) {
137141
fprintf(stderr, "Illegal \"index\"\n");

tc/m_mirred.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ parse_direction(struct action_util *a, int *argc_p, char ***argv_p,
202202

203203

204204
if (p.eaction == TCA_EGRESS_MIRROR || p.eaction == TCA_INGRESS_MIRROR)
205-
parse_action_control(&argc, &argv, &p.action, false);
205+
parse_action_control_dflt(&argc, &argv, &p.action, false,
206+
TC_ACT_PIPE);
206207

207208
if (argc) {
208209
if (iok && matches(*argv, "index") == 0) {

tc/m_simple.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ parse_simple(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
120120
}
121121
}
122122

123+
parse_action_control_dflt(&argc, &argv, &sel.action, false,
124+
TC_ACT_PIPE);
125+
123126
if (argc) {
124127
if (matches(*argv, "index") == 0) {
125128
NEXT_ARG();
@@ -145,8 +148,6 @@ parse_simple(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
145148
return -1;
146149
}
147150

148-
sel.action = TC_ACT_PIPE;
149-
150151
tail = addattr_nest(n, MAX_MSG, tca_id);
151152
addattr_l(n, MAX_MSG, TCA_DEF_PARMS, &sel, sizeof(sel));
152153
if (simpdata)

0 commit comments

Comments
 (0)