]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
iplink: bridge: add support for IFLA_BR_MCAST_HASH_MAX
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Mon, 8 Feb 2016 23:14:30 +0000 (00:14 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 9 Feb 2016 18:42:03 +0000 (10:42 -0800)
This patch implements support for the IFLA_BR_MCAST_HASH_MAX attribute
in iproute2 so it can change the maximum hashed entries.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
ip/iplink_bridge.c

index 93dcc982c6237cdaa75068add1caa2737057c709..f912c318c24a39cb3acf254c9223c08c2213d5df 100644 (file)
@@ -38,6 +38,7 @@ static void print_explain(FILE *f)
                "                  [ mcast_query_use_ifaddr MCAST_QUERY_USE_IFADDR ]\n"
                "                  [ mcast_querier MULTICAST_QUERIER ]\n"
                "                  [ mcast_hash_elasticity HASH_ELASTICITY ]\n"
+               "                  [ mcast_hash_max HASH_MAX ]\n"
                "\n"
                "Where: VLAN_PROTOCOL := { 802.1Q | 802.1ad }\n"
        );
@@ -189,6 +190,15 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
 
                        addattr32(n, 1024, IFLA_BR_MCAST_HASH_ELASTICITY,
                                  mcast_hash_el);
+               } else if (matches(*argv, "mcast_hash_max") == 0) {
+                       __u32 mcast_hash_max;
+
+                       NEXT_ARG();
+                       if (get_u32(&mcast_hash_max, *argv, 0))
+                               invarg("invalid mcast_hash_max", *argv);
+
+                       addattr32(n, 1024, IFLA_BR_MCAST_HASH_MAX,
+                                 mcast_hash_max);
                } else if (matches(*argv, "help") == 0) {
                        explain();
                        return -1;
@@ -346,6 +356,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
        if (tb[IFLA_BR_MCAST_HASH_ELASTICITY])
                fprintf(f, "mcast_hash_elasticity %u ",
                        rta_getattr_u32(tb[IFLA_BR_MCAST_HASH_ELASTICITY]));
+
+       if (tb[IFLA_BR_MCAST_HASH_MAX])
+               fprintf(f, "mcast_hash_max %u ",
+                       rta_getattr_u32(tb[IFLA_BR_MCAST_HASH_MAX]));
 }
 
 static void bridge_print_help(struct link_util *lu, int argc, char **argv,