switch-config: fix multicast/broadcast limit support master
authorGrygorii Strashko <grygorii.strashko@ti.com>
Fri, 8 Sep 2017 23:14:15 +0000 (18:14 -0500)
committerSekhar Nori <nsekhar@ti.com>
Thu, 14 Sep 2017 11:11:34 +0000 (16:41 +0530)
switch-config tool now accepts MC/BC ratelimit parameters, but doesn't send
ioctl request to the Kernel, hence fix it.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
switch-config.c

index 882c074e8400506fb8dd30ae1928ca71399d0c2b..11364958a023cc81931b29efbd11cb0f111b8d26 100644 (file)
@@ -949,6 +949,22 @@ int main(int argc, char **argv)
                                return -1;
                        }
                break;
+               case CONFIG_SWITCH_RATELIMIT:
+                       if ((port_num <= 2)) {
+                               cmd_struct.port = port_num;
+                               if (ioctl(sockfd, SIOCSWITCHCONFIG, &ifr) < 0) {
+                                       printf("Set Port B/M ratelimit Failed\n");
+                                       close(sockfd);
+                                       return -1;
+                               } else {
+                                       printf("Set Port B/M ratelimit successful\n");
+                               }
+                       } else {
+                               printf("Invalid Arguments\n");
+                               return -1;
+                       }
+               break;
+
        }
 
        close(sockfd);