]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
iflink_vlan: support GVRP flag
authorPatrick McHardy <kaber@trash.net>
Thu, 3 Jul 2008 17:06:29 +0000 (19:06 +0200)
committerStephen Hemminger <stephen.hemminger@vyatta.com>
Thu, 18 Sep 2008 04:54:34 +0000 (21:54 -0700)
This is the patch for iproute for configuring GVRP.

commit 32143eed8b706e5c6554ab42903533b3bccdc060
Author: Patrick McHardy <kaber@trash.net>
Date:   Thu Jul 3 19:05:09 2008 +0200

    [IPROUTE]: iflink_vlan: support GVRP flag

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
ip/iplink_vlan.c

index 19648395c47c1ef5a7788e48ab2018189b25351d..97244826aeadeaaa7bfbb1b8934652822afc31bf 100644 (file)
@@ -26,7 +26,7 @@ static void explain(void)
                "\n"
                "VLANID := 0-4095\n"
                "FLAG-LIST := [ FLAG-LIST ] FLAG\n"
-               "FLAG := [ reorder_hdr { on | off } ]\n"
+               "FLAG := [ reorder_hdr { on | off } ] [ gvrp { on | off } ]\n"
                "QOS-MAP := [ QOS-MAP ] QOS-MAPPING\n"
                "QOS-MAPPING := FROM:TO\n"
        );
@@ -93,6 +93,15 @@ static int vlan_parse_opt(struct link_util *lu, int argc, char **argv,
                                flags.flags &= ~VLAN_FLAG_REORDER_HDR;
                        else
                                return on_off("reorder_hdr");
+               } else if (matches(*argv, "gvrp") == 0) {
+                       NEXT_ARG();
+                       flags.mask |= VLAN_FLAG_GVRP;
+                       if (strcmp(*argv, "on") == 0)
+                               flags.flags |= VLAN_FLAG_GVRP;
+                       else if (strcmp(*argv, "off") == 0)
+                               flags.flags &= ~VLAN_FLAG_GVRP;
+                       else
+                               return on_off("gvrp");
                } else if (matches(*argv, "ingress-qos-map") == 0) {
                        NEXT_ARG();
                        if (vlan_parse_qos_map(&argc, &argv, n,
@@ -146,6 +155,7 @@ static void vlan_print_flags(FILE *fp, __u32 flags)
                        fprintf(fp, #f "%s", flags ? "," : ""); \
                }
        _PF(REORDER_HDR);
+       _PF(GVRP);
 #undef _PF
        if (flags)
                fprintf(fp, "%x", flags);