[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231017070227.3560105-2-amcohen@nvidia.com>
Date: Tue, 17 Oct 2023 10:02:20 +0300
From: Amit Cohen <amcohen@...dia.com>
To: <netdev@...r.kernel.org>
CC: <dsahern@...il.com>, <stephen@...workplumber.org>, <razor@...ckwall.org>,
<mlxsw@...dia.com>, <roopa@...dia.com>, Amit Cohen <amcohen@...dia.com>
Subject: [PATCH iproute2-next 1/8] bridge: fdb: rename some variables to contain 'brport'
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@...dia.com>
---
bridge/fdb.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/bridge/fdb.c b/bridge/fdb.c
index d7ef26fd..e01e14f1 100644
--- a/bridge/fdb.c
+++ b/bridge/fdb.c
@@ -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)
--
2.41.0
Powered by blists - more mailing lists