summaryrefslogtreecommitdiff
path: root/ripngd/ripng_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 /ripngd/ripng_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 'ripngd/ripng_debug.c')
-rw-r--r--ripngd/ripng_debug.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/ripngd/ripng_debug.c b/ripngd/ripng_debug.c
index 9ebc302b1b..c8cad23add 100644
--- a/ripngd/ripng_debug.c
+++ b/ripngd/ripng_debug.c
@@ -94,13 +94,9 @@ DEFUN (debug_ripng_packet_direct,
{
int idx_recv_send = 3;
ripng_debug_packet |= RIPNG_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)
ripng_debug_packet |= RIPNG_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)
ripng_debug_packet |= RIPNG_DEBUG_RECV;
return CMD_SUCCESS;
@@ -152,16 +148,12 @@ DEFUN (no_debug_ripng_packet_direct,
"Debug 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_RIPNG_DEBUG_RECV)
ripng_debug_packet &= ~RIPNG_DEBUG_SEND;
else
ripng_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_RIPNG_DEBUG_SEND)
ripng_debug_packet &= ~RIPNG_DEBUG_RECV;
else