Merge branch 'master' into net-next

This commit is contained in:
Stephen Hemminger 2016-06-27 11:30:06 -07:00
commit 131351086e
6 changed files with 57 additions and 30 deletions

View File

@ -299,6 +299,6 @@ int do_vlan(int argc, char **argv)
} else
return vlan_show(0, NULL);
fprintf(stderr, "Command \"%s\" is unknown, try \"bridge fdb help\".\n", *argv);
fprintf(stderr, "Command \"%s\" is unknown, try \"bridge vlan help\".\n", *argv);
exit(-1);
}

View File

@ -491,7 +491,7 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
} else if (matches(*argv, "address") == 0) {
NEXT_ARG();
addr_len = ll_addr_a2n(abuf, sizeof(abuf), *argv);
if (len < 0)
if (addr_len < 0)
return -1;
addattr_l(&req->n, sizeof(*req), IFLA_ADDRESS, abuf, addr_len);
} else if (matches(*argv, "broadcast") == 0 ||

View File

@ -112,47 +112,44 @@ static int process_msg(const struct sockaddr_nl *who, struct nlmsghdr *n,
parse_rtattr(attrs, TCP_METRICS_ATTR_MAX, (void *) ghdr + GENL_HDRLEN,
len);
a = attrs[TCP_METRICS_ATTR_ADDR_IPV4];
if (a) {
if (attrs[TCP_METRICS_ATTR_ADDR_IPV4]) {
if (f.daddr.family && f.daddr.family != AF_INET)
return 0;
a = attrs[TCP_METRICS_ATTR_ADDR_IPV4];
memcpy(&daddr.data, RTA_DATA(a), 4);
daddr.bytelen = 4;
family = AF_INET;
atype = TCP_METRICS_ATTR_ADDR_IPV4;
dlen = RTA_PAYLOAD(a);
} else {
a = attrs[TCP_METRICS_ATTR_ADDR_IPV6];
if (a) {
if (f.daddr.family && f.daddr.family != AF_INET6)
return 0;
memcpy(&daddr.data, RTA_DATA(a), 16);
daddr.bytelen = 16;
family = AF_INET6;
atype = TCP_METRICS_ATTR_ADDR_IPV6;
dlen = RTA_PAYLOAD(a);
} else
} else if (attrs[TCP_METRICS_ATTR_ADDR_IPV6]) {
if (f.daddr.family && f.daddr.family != AF_INET6)
return 0;
a = attrs[TCP_METRICS_ATTR_ADDR_IPV6];
memcpy(&daddr.data, RTA_DATA(a), 16);
daddr.bytelen = 16;
family = AF_INET6;
atype = TCP_METRICS_ATTR_ADDR_IPV6;
dlen = RTA_PAYLOAD(a);
} else {
return 0;
}
a = attrs[TCP_METRICS_ATTR_SADDR_IPV4];
if (a) {
if (attrs[TCP_METRICS_ATTR_SADDR_IPV4]) {
if (f.saddr.family && f.saddr.family != AF_INET)
return 0;
a = attrs[TCP_METRICS_ATTR_SADDR_IPV4];
memcpy(&saddr.data, RTA_DATA(a), 4);
saddr.bytelen = 4;
stype = TCP_METRICS_ATTR_SADDR_IPV4;
slen = RTA_PAYLOAD(a);
} else {
} else if (attrs[TCP_METRICS_ATTR_SADDR_IPV6]) {
if (f.saddr.family && f.saddr.family != AF_INET6)
return 0;
a = attrs[TCP_METRICS_ATTR_SADDR_IPV6];
if (a) {
if (f.saddr.family && f.saddr.family != AF_INET6)
return 0;
memcpy(&saddr.data, RTA_DATA(a), 16);
saddr.bytelen = 16;
stype = TCP_METRICS_ATTR_SADDR_IPV6;
slen = RTA_PAYLOAD(a);
}
memcpy(&saddr.data, RTA_DATA(a), 16);
saddr.bytelen = 16;
stype = TCP_METRICS_ATTR_SADDR_IPV6;
slen = RTA_PAYLOAD(a);
}
if (f.daddr.family && f.daddr.bitlen >= 0 &&

View File

@ -234,7 +234,7 @@ error.
.sp
.B 1
- STP LISTENING state. Only valid if STP is enabled on the brige. In this
- STP LISTENING state. Only valid if STP is enabled on the bridge. In this
state the port for list for STP BPDUs and drop all other traffic.
.sp
@ -551,8 +551,8 @@ device is the bridge device.
.BI master
the vlan is configured on the software bridge (default).
.SS bridge vlan delete - delete a forwarding database entry
This command removes an existing fdb entry.
.SS bridge vlan delete - delete a vlan filter entry
This command removes an existing vlan filter entry.
.PP
The arguments are the same as with

View File

@ -280,6 +280,12 @@ only list interfaces enslaved to this master device.
.BI type " TYPE"
only list interfaces of the given type.
Note that the type name is not checked against the list of supported types -
instead it is sent as-is to the kernel. Later it is used to filter the returned
interface list by comparing it with the relevant attribute in case the kernel
didn't filter already. Therefore any string is accepted, but may lead to empty
output.
.TP
.B up
only list running interfaces.

View File

@ -65,7 +65,8 @@ ip-link \- network device configuration
.BR nlmon " |"
.BR ipvlan " |"
.BR lowpan " |"
.BR geneve " ]"
.BR geneve " |"
.BR vrf " ]"
.ti -8
.BR "ip link delete " {
@ -263,6 +264,9 @@ Link types:
.sp
.BR macsec
- Interface for IEEE 802.1AE MAC Security (MACsec)
.sp
.BR vrf
- Interface for L3 VRF domains
.in -8
.TP
@ -966,6 +970,20 @@ the following additional arguments are supported:
.in -8
.TP
VRF Type Support
For a link of type
.I VRF
the following additional arguments are supported:
.BI "ip link add " DEVICE " type vrf table " TABLE
.in +8
.sp
.BR table " table id associated with VRF device"
.in -8
.SS ip link delete - delete virtual link
.TP
@ -1242,6 +1260,12 @@ specifies the master device which enslaves devices to show.
.I TYPE
specifies the type of devices to show.
Note that the type name is not checked against the list of supported types -
instead it is sent as-is to the kernel. Later it is used to filter the returned
interface list by comparing it with the relevant attribute in case the kernel
didn't filter already. Therefore any string is accepted, but may lead to empty
output.
.SS ip link help - display help
.PP