]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
iplink_vlan: add support for VLAN bridge binding flag
authorMike Manning <mmanning@vyatta.att-mail.com>
Sat, 20 Apr 2019 10:45:37 +0000 (11:45 +0100)
committerDavid Ahern <dsahern@gmail.com>
Fri, 26 Apr 2019 18:12:58 +0000 (11:12 -0700)
This patch adds support for the VLAN bridge binding flag that is
provided in net-next kernel by the series merged by 1ab839281cf7
("net-support-binding-vlan-dev-link-state-to-vlan-member-bridge-ports")

Signed-off-by: Mike Manning <mmanning@vyatta.att-mail.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
ip/iplink_vlan.c
man/man8/ip-link.8.in

index 08e499560db6e2b8b7a71ce72294425dd1834db5..26f6ee8358d27e6a613853a82751e9c11653bec7 100644 (file)
@@ -27,6 +27,7 @@ static void print_explain(FILE *f)
                "                [ gvrp { on | off } ]\n"
                "                [ mvrp { on | off } ]\n"
                "                [ loose_binding { on | off } ]\n"
+               "                [ bridge_binding { on | off } ]\n"
                "                [ ingress-qos-map QOS-MAP ]\n"
                "                [ egress-qos-map QOS-MAP ]\n"
                "\n"
@@ -134,6 +135,15 @@ static int vlan_parse_opt(struct link_util *lu, int argc, char **argv,
                                flags.flags &= ~VLAN_FLAG_LOOSE_BINDING;
                        else
                                return on_off("loose_binding", *argv);
+               } else if (matches(*argv, "bridge_binding") == 0) {
+                       NEXT_ARG();
+                       flags.mask |= VLAN_FLAG_BRIDGE_BINDING;
+                       if (strcmp(*argv, "on") == 0)
+                               flags.flags |= VLAN_FLAG_BRIDGE_BINDING;
+                       else if (strcmp(*argv, "off") == 0)
+                               flags.flags &= ~VLAN_FLAG_BRIDGE_BINDING;
+                       else
+                               return on_off("bridge_binding", *argv);
                } else if (matches(*argv, "ingress-qos-map") == 0) {
                        NEXT_ARG();
                        if (vlan_parse_qos_map(&argc, &argv, n,
@@ -204,6 +214,7 @@ static void vlan_print_flags(FILE *fp, __u32 flags)
        _PF(GVRP);
        _PF(MVRP);
        _PF(LOOSE_BINDING);
+       _PF(BRIDGE_BINDING);
 #undef _PF
        if (flags)
                print_hex(PRINT_ANY, NULL, "%x", flags);
index 628a365108e339a0e4a93f14226eae3cd565a530..d035a5c92ed5594f4d030d10f2a853d8ca47958b 100644 (file)
@@ -406,6 +406,9 @@ the following additional arguments are supported:
 .BR loose_binding " { " on " | " off " } "
 ]
 [
+.BR bridge_binding " { " on " | " off " } "
+]
+[
 .BI ingress-qos-map " QOS-MAP "
 ]
 [
@@ -459,6 +462,10 @@ where <phy_dev> is the physical device to which VLAN device is bound.
 .BR loose_binding " { " on " | " off " } "
 - specifies whether the VLAN device state is bound to the physical device state.
 
+.BR bridge_binding " { " on " | " off " } "
+- specifies whether the VLAN device link state tracks the state of bridge ports
+that are members of the VLAN.
+
 .BI ingress-qos-map " QOS-MAP "
 - defines a mapping of VLAN header prio field to the Linux internal packet
 priority on incoming frames. The format is FROM:TO with multiple mappings