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 <iryzhov@nfware.com>
This commit is contained in:
Igor Ryzhov 2021-05-26 11:48:09 +03:00
parent 63d00b52e7
commit c9ac777a7e

View File

@ -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",
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",
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]);
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]);
}
return 0;