Commit
d3432bf10f17 ("net: Support filtering interfaces on no master")
in the kernel added support for filtering interfaces/neighbours that
have no master interface.
This patch completes it and adds this support to iproute2:
1. ip link show nomaster
2. ip address show nomaster
3. ip neighbour {show | flush} nomaster
Signed-off-by: Lahav Schlesinger <lschlesinger@drivenets.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
" ip address {save|flush} [ dev IFNAME ] [ scope SCOPE-ID ]\n"
" [ to PREFIX ] [ FLAG-LIST ] [ label LABEL ] [up]\n"
" ip address [ show [ dev IFNAME ] [ scope SCOPE-ID ] [ master DEVICE ]\n"
+ " [ nomaster ]\n"
" [ type TYPE ] [ to PREFIX ] [ FLAG-LIST ]\n"
" [ label LABEL ] [up] [ vrf NAME ] ]\n"
" ip address {showdump|restore}\n"
if (!name_is_vrf(*argv))
invarg("Not a valid VRF name\n", *argv);
filter.master = ifindex;
+ } else if (strcmp(*argv, "nomaster") == 0) {
+ filter.master = -1;
} else if (strcmp(*argv, "type") == 0) {
int soff;
" [ gso_max_size BYTES ] | [ gso_max_segs PACKETS ]\n"
"\n"
" ip link show [ DEVICE | group GROUP ] [up] [master DEV] [vrf NAME] [type TYPE]\n"
+ " [nomaster]\n"
"\n"
" ip link xstats type TYPE [ ARGS ]\n"
"\n"
" [ dev DEV ] [ router ] [ extern_learn ] [ protocol PROTO ]\n"
"\n"
" ip neigh { show | flush } [ proxy ] [ to PREFIX ] [ dev DEV ] [ nud STATE ]\n"
- " [ vrf NAME ]\n"
+ " [ vrf NAME ] [ nomaster ]\n"
" ip neigh get { ADDR | proxy ADDR } dev DEV\n"
"\n"
"STATE := { delay | failed | incomplete | noarp | none |\n"
if (!name_is_vrf(*argv))
invarg("Not a valid VRF name\n", *argv);
filter.master = ifindex;
+ } else if (strcmp(*argv, "nomaster") == 0) {
+ filter.master = -1;
} else if (strcmp(*argv, "unused") == 0) {
filter.unused_only = 1;
} else if (strcmp(*argv, "nud") == 0) {
.IR TYPE " ] [ "
.B vrf
.IR NAME " ] [ "
-.BR up " ] ]"
+.BR up " ] ["
+.BR nomaster " ] ]"
.ti -8
.BR "ip address" " { " showdump " | " restore " }"
.B up
only list running interfaces.
+.TP
+.B nomaster
+only list interfaces with no master.
+
.TP
.BR dynamic " and " permanent
(IPv6 only) only list addresses installed due to stateless
.B type
.IR ETYPE " ] ["
.B vrf
-.IR NAME " ]"
+.IR NAME " ] ["
+.BR nomaster " ]"
.ti -8
.B ip link xstats
didn't filter already. Therefore any string is accepted, but may lead to empty
output.
+.TP
+.B nomaster
+only show devices with no master
+
.SS ip link xstats - display extended statistics
.TP
.B nud
.IR STATE " ] [ "
.B vrf
-.IR NAME " ] "
+.IR NAME " ] ["
+.BR nomaster " ]"
.ti -8
.B ip neigh get
.BI vrf " NAME"
only list the neighbours for given VRF.
+.TP
+.BI nomaster
+only list neighbours attached to an interface with no master.
+
.TP
.BI proxy
list neighbour proxies.