]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
bridge: fdb: rename some variables to contain 'brport'
authorAmit Cohen <amcohen@nvidia.com>
Tue, 17 Oct 2023 10:55:25 +0000 (13:55 +0300)
committerDavid Ahern <dsahern@kernel.org>
Fri, 20 Oct 2023 15:42:21 +0000 (09:42 -0600)
Currently, the flush command supports the keyword 'brport'. To handle
this argument the variables 'port_ifidx' and 'port' are used.

A following patch will add support for 'port' keyword in flush command,
rename the existing variables to include 'brport' prefix, so then it
will be clear that they are used to parse 'brport' argument.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: David Ahern <dsahern@kernel.org>
bridge/fdb.c

index d7ef26fd75b80fc31ea3909eb34cfb074460a234..e01e14f18d26ab51ae5bee1f9cbabe810ecdd1dd 100644 (file)
@@ -696,10 +696,10 @@ static int fdb_flush(int argc, char **argv)
        };
        unsigned short ndm_state_mask = 0;
        unsigned short ndm_flags_mask = 0;
-       short vid = -1, port_ifidx = -1;
+       short vid = -1, brport_ifidx = -1;
+       char *d = NULL, *brport = NULL;
        unsigned short ndm_flags = 0;
        unsigned short ndm_state = 0;
-       char *d = NULL, *port = NULL;
 
        while (argc > 0) {
                if (strcmp(*argv, "dev") == 0) {
@@ -752,10 +752,10 @@ static int fdb_flush(int argc, char **argv)
                        ndm_flags &= ~NTF_OFFLOADED;
                        ndm_flags_mask |= NTF_OFFLOADED;
                } else if (strcmp(*argv, "brport") == 0) {
-                       if (port)
+                       if (brport)
                                duparg2("brport", *argv);
                        NEXT_ARG();
-                       port = *argv;
+                       brport = *argv;
                } else if (strcmp(*argv, "vlan") == 0) {
                        if (vid >= 0)
                                duparg2("vlan", *argv);
@@ -783,11 +783,11 @@ static int fdb_flush(int argc, char **argv)
                return -1;
        }
 
-       if (port) {
-               port_ifidx = ll_name_to_index(port);
-               if (port_ifidx == 0) {
+       if (brport) {
+               brport_ifidx = ll_name_to_index(brport);
+               if (brport_ifidx == 0) {
                        fprintf(stderr, "Cannot find bridge port device \"%s\"\n",
-                               port);
+                               brport);
                        return -1;
                }
        }
@@ -803,8 +803,8 @@ static int fdb_flush(int argc, char **argv)
 
        req.ndm.ndm_flags = ndm_flags;
        req.ndm.ndm_state = ndm_state;
-       if (port_ifidx > -1)
-               addattr32(&req.n, sizeof(req), NDA_IFINDEX, port_ifidx);
+       if (brport_ifidx > -1)
+               addattr32(&req.n, sizeof(req), NDA_IFINDEX, brport_ifidx);
        if (vid > -1)
                addattr16(&req.n, sizeof(req), NDA_VLAN, vid);
        if (ndm_flags_mask)