summaryrefslogtreecommitdiff
path: root/babeld/babel_zebra.c
diff options
context:
space:
mode:
authorsri-mohan1 <sri.mohan@samsung.com>2023-02-14 15:59:29 +0530
committersri-mohan1 <sri.mohan@samsung.com>2023-02-14 15:59:29 +0530
commit03b7208c4c5b8a31e6fdc5eb7831e218701570d3 (patch)
treeb99e544e0a71ce2beb25bf85423aa1c01ee040de /babeld/babel_zebra.c
parent44fab24d25cb9aca539578d91360cb37f7bb4278 (diff)
babeld: changes for code maintainability
These changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
Diffstat (limited to 'babeld/babel_zebra.c')
-rw-r--r--babeld/babel_zebra.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/babeld/babel_zebra.c b/babeld/babel_zebra.c
index daaa870a64..bc8274d21a 100644
--- a/babeld/babel_zebra.c
+++ b/babeld/babel_zebra.c
@@ -139,7 +139,7 @@ DEFUN (debug_babel,
for(i = 0; debug_type[i].str != NULL; i++) {
if (strncmp (debug_type[i].str, argv[2]->arg,
debug_type[i].str_min_len) == 0) {
- debug |= debug_type[i].type;
+ SET_FLAG(debug, debug_type[i].type);
return CMD_SUCCESS;
}
}
@@ -169,7 +169,7 @@ DEFUN (no_debug_babel,
for (i = 0; debug_type[i].str; i++) {
if (strncmp(debug_type[i].str, argv[3]->arg,
debug_type[i].str_min_len) == 0) {
- debug &= ~debug_type[i].type;
+ UNSET_FLAG(debug, debug_type[i].type);
return CMD_SUCCESS;
}
}
@@ -195,16 +195,18 @@ debug_babel_config_write (struct vty * vty)
lines++;
}
else
+ {
for (i = 0; debug_type[i].str != NULL; i++)
- if
- (
- debug_type[i].type != BABEL_DEBUG_ALL
- && CHECK_FLAG (debug, debug_type[i].type)
- )
+ {
+ if (debug_type[i].type != BABEL_DEBUG_ALL
+ && CHECK_FLAG (debug, debug_type[i].type))
{
vty_out (vty, "debug babel %s\n", debug_type[i].str);
lines++;
}
+ }
+ }
+
if (lines)
{
vty_out (vty, "!\n");