summaryrefslogtreecommitdiff
path: root/ripd/rip_debug.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2017-10-05 22:31:54 -0300
committerRenato Westphal <renato@opensourcerouting.org>2017-10-05 22:54:42 -0300
commit8034beff9f153e265040b94a355c1057d56d59f0 (patch)
tree5005743e8a9428c0535b875bfd4181b0d40d6d28 /ripd/rip_debug.c
parent993bab898d4aff3a29bc041e6b45488b5a9cfa12 (diff)
*: use argv[]->text instead of argv[]->arg when appropriate
Incomplete commands like "debug ospf6 route mem" were being ignored. The changes in ripd and ripngd are intended to make the code easier to read, no bugs were fixed in these two daemons. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ripd/rip_debug.c')
-rw-r--r--ripd/rip_debug.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/ripd/rip_debug.c b/ripd/rip_debug.c
index 56ba8e7f3e..2ce289e38f 100644
--- a/ripd/rip_debug.c
+++ b/ripd/rip_debug.c
@@ -93,13 +93,9 @@ DEFUN (debug_rip_packet_direct,
{
int idx_recv_send = 3;
rip_debug_packet |= RIP_DEBUG_PACKET;
- if (strncmp("send", argv[idx_recv_send]->arg,
- strlen(argv[idx_recv_send]->arg))
- == 0)
+ if (strcmp("send", argv[idx_recv_send]->text) == 0)
rip_debug_packet |= RIP_DEBUG_SEND;
- if (strncmp("recv", argv[idx_recv_send]->arg,
- strlen(argv[idx_recv_send]->arg))
- == 0)
+ if (strcmp("recv", argv[idx_recv_send]->text) == 0)
rip_debug_packet |= RIP_DEBUG_RECV;
return CMD_SUCCESS;
}
@@ -150,16 +146,12 @@ DEFUN (no_debug_rip_packet_direct,
"RIP option set for send packet\n")
{
int idx_recv_send = 4;
- if (strncmp("send", argv[idx_recv_send]->arg,
- strlen(argv[idx_recv_send]->arg))
- == 0) {
+ if (strcmp("send", argv[idx_recv_send]->text) == 0) {
if (IS_RIP_DEBUG_RECV)
rip_debug_packet &= ~RIP_DEBUG_SEND;
else
rip_debug_packet = 0;
- } else if (strncmp("recv", argv[idx_recv_send]->arg,
- strlen(argv[idx_recv_send]->arg))
- == 0) {
+ } else if (strcmp("recv", argv[idx_recv_send]->text) == 0) {
if (IS_RIP_DEBUG_SEND)
rip_debug_packet &= ~RIP_DEBUG_RECV;
else