From c9ac777a7ebde6ebf0f48d4d081907871a1c3cef Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Wed, 26 May 2021 11:48:09 +0300 Subject: [PATCH] ospf6d: fix debug message config write Fix the following issues: - if "send" is combined with "recv-hdr", only "send" is shown - if "recv" is combined with "send-hdr", only "recv" is shown - if both "send-hdr" and "recv-hdr" are enabled, "; header only" is shown Signed-off-by: Igor Ryzhov --- ospf6d/ospf6_message.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c index d2dcfd81d4..f83be7b49c 100644 --- a/ospf6d/ospf6_message.c +++ b/ospf6d/ospf6_message.c @@ -2669,24 +2669,24 @@ int config_write_ospf6_debug_message(struct vty *vty) for (i = 1; i < 6; i++) { if (IS_OSPF6_DEBUG_MESSAGE_ENABLED(i, SEND) - && IS_OSPF6_DEBUG_MESSAGE_ENABLED(i, RECV)) + && IS_OSPF6_DEBUG_MESSAGE_ENABLED(i, RECV)) { vty_out(vty, "debug ospf6 message %s\n", type_str[i]); - else if (IS_OSPF6_DEBUG_MESSAGE_ENABLED(i, SEND)) + continue; + } + + if (IS_OSPF6_DEBUG_MESSAGE_ENABLED(i, SEND)) vty_out(vty, "debug ospf6 message %s send\n", type_str[i]); - else if (IS_OSPF6_DEBUG_MESSAGE_ENABLED(i, RECV)) - vty_out(vty, "debug ospf6 message %s recv\n", + else if (IS_OSPF6_DEBUG_MESSAGE_ENABLED(i, SEND_HDR)) + vty_out(vty, "debug ospf6 message %s send-hdr\n", type_str[i]); - else if (IS_OSPF6_DEBUG_MESSAGE_ENABLED(i, SEND_HDR) - && IS_OSPF6_DEBUG_MESSAGE_ENABLED(i, RECV_HDR)) - vty_out(vty, "debug ospf6 message %s; header only\n", + + if (IS_OSPF6_DEBUG_MESSAGE_ENABLED(i, RECV)) + vty_out(vty, "debug ospf6 message %s recv\n", type_str[i]); else if (IS_OSPF6_DEBUG_MESSAGE_ENABLED(i, RECV_HDR)) vty_out(vty, "debug ospf6 message %s recv-hdr\n", type_str[i]); - else if (IS_OSPF6_DEBUG_MESSAGE_ENABLED(i, SEND_HDR)) - vty_out(vty, "debug ospf6 message %s send-hdr\n", - type_str[i]); } return 0; -- 2.39.5