zebra: Change bitwise operations to purpose-built macros
Some bitfields for zebra_debug_* flags were being modified
with bitwise operators instead of the purpose-built macros
in lib/zebra.h. Changed such instances to use the macros.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Acked-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
Tested-by: NetDEF CI System <cisystem@netdef.org>
diff --git a/zebra/debug.c b/zebra/debug.c
index 5dd38f0..7d023ce 100644
--- a/zebra/debug.c
+++ b/zebra/debug.c
@@ -111,8 +111,8 @@
"Debug option set for zebra packet\n")
{
zebra_debug_packet = ZEBRA_DEBUG_PACKET;
- zebra_debug_packet |= ZEBRA_DEBUG_SEND;
- zebra_debug_packet |= ZEBRA_DEBUG_RECV;
+ SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_SEND);
+ SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_RECV);
return CMD_SUCCESS;
}
@@ -127,11 +127,11 @@
{
zebra_debug_packet = ZEBRA_DEBUG_PACKET;
if (strncmp ("send", argv[0], strlen (argv[0])) == 0)
- zebra_debug_packet |= ZEBRA_DEBUG_SEND;
+ SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_SEND);
if (strncmp ("recv", argv[0], strlen (argv[0])) == 0)
- zebra_debug_packet |= ZEBRA_DEBUG_RECV;
+ SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_RECV);
if (strncmp ("detail", argv[0], strlen (argv[0])) == 0)
- zebra_debug_packet |= ZEBRA_DEBUG_DETAIL;
+ SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_DETAIL);
return CMD_SUCCESS;
}
@@ -147,10 +147,10 @@
{
zebra_debug_packet = ZEBRA_DEBUG_PACKET;
if (strncmp ("send", argv[0], strlen (argv[0])) == 0)
- zebra_debug_packet |= ZEBRA_DEBUG_SEND;
+ SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_SEND);
if (strncmp ("recv", argv[0], strlen (argv[0])) == 0)
- zebra_debug_packet |= ZEBRA_DEBUG_RECV;
- zebra_debug_packet |= ZEBRA_DEBUG_DETAIL;
+ SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_RECV);
+ SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_DETAIL);
return CMD_SUCCESS;
}
@@ -246,9 +246,9 @@
"Debug option set for send packet\n")
{
if (strncmp ("send", argv[0], strlen (argv[0])) == 0)
- zebra_debug_packet &= ~ZEBRA_DEBUG_SEND;
+ UNSET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_SEND);
if (strncmp ("recv", argv[0], strlen (argv[0])) == 0)
- zebra_debug_packet &= ~ZEBRA_DEBUG_RECV;
+ UNSET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_RECV);
return CMD_SUCCESS;
}