mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 04:26:12 +00:00
*: 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>
This commit is contained in:
parent
993bab898d
commit
8034beff9f
@ -3102,11 +3102,11 @@ DEFUN (bgp_evpn_vni_rt,
|
||||
if (!bgp || !vpn)
|
||||
return CMD_WARNING;
|
||||
|
||||
if (!strcmp(argv[1]->arg, "import"))
|
||||
if (!strcmp(argv[1]->text, "import"))
|
||||
rt_type = RT_TYPE_IMPORT;
|
||||
else if (!strcmp(argv[1]->arg, "export"))
|
||||
else if (!strcmp(argv[1]->text, "export"))
|
||||
rt_type = RT_TYPE_EXPORT;
|
||||
else if (!strcmp(argv[1]->arg, "both"))
|
||||
else if (!strcmp(argv[1]->text, "both"))
|
||||
rt_type = RT_TYPE_BOTH;
|
||||
else {
|
||||
vty_out(vty, "%% Invalid Route Target type\n");
|
||||
@ -3164,11 +3164,11 @@ DEFUN (no_bgp_evpn_vni_rt,
|
||||
if (!bgp || !vpn)
|
||||
return CMD_WARNING;
|
||||
|
||||
if (!strcmp(argv[2]->arg, "import"))
|
||||
if (!strcmp(argv[2]->text, "import"))
|
||||
rt_type = RT_TYPE_IMPORT;
|
||||
else if (!strcmp(argv[2]->arg, "export"))
|
||||
else if (!strcmp(argv[2]->text, "export"))
|
||||
rt_type = RT_TYPE_EXPORT;
|
||||
else if (!strcmp(argv[2]->arg, "both"))
|
||||
else if (!strcmp(argv[2]->text, "both"))
|
||||
rt_type = RT_TYPE_BOTH;
|
||||
else {
|
||||
vty_out(vty, "%% Invalid Route Target type\n");
|
||||
@ -3257,9 +3257,9 @@ DEFUN (no_bgp_evpn_vni_rt_without_val,
|
||||
if (!bgp || !vpn)
|
||||
return CMD_WARNING;
|
||||
|
||||
if (!strcmp(argv[2]->arg, "import")) {
|
||||
if (!strcmp(argv[2]->text, "import")) {
|
||||
rt_type = RT_TYPE_IMPORT;
|
||||
} else if (!strcmp(argv[2]->arg, "export")) {
|
||||
} else if (!strcmp(argv[2]->text, "export")) {
|
||||
rt_type = RT_TYPE_EXPORT;
|
||||
} else {
|
||||
vty_out(vty, "%% Invalid Route Target type\n");
|
||||
|
@ -1469,13 +1469,13 @@ DEFUN (debug_ospf6_route,
|
||||
int idx_type = 3;
|
||||
unsigned char level = 0;
|
||||
|
||||
if (!strncmp(argv[idx_type]->arg, "table", 5))
|
||||
if (!strcmp(argv[idx_type]->text, "table"))
|
||||
level = OSPF6_DEBUG_ROUTE_TABLE;
|
||||
else if (!strncmp(argv[idx_type]->arg, "intra", 5))
|
||||
else if (!strcmp(argv[idx_type]->text, "intra-area"))
|
||||
level = OSPF6_DEBUG_ROUTE_INTRA;
|
||||
else if (!strncmp(argv[idx_type]->arg, "inter", 5))
|
||||
else if (!strcmp(argv[idx_type]->text, "inter-area"))
|
||||
level = OSPF6_DEBUG_ROUTE_INTER;
|
||||
else if (!strncmp(argv[idx_type]->arg, "memor", 5))
|
||||
else if (!strcmp(argv[idx_type]->text, "memory"))
|
||||
level = OSPF6_DEBUG_ROUTE_MEMORY;
|
||||
OSPF6_DEBUG_ROUTE_ON(level);
|
||||
return CMD_SUCCESS;
|
||||
@ -1496,13 +1496,13 @@ DEFUN (no_debug_ospf6_route,
|
||||
int idx_type = 4;
|
||||
unsigned char level = 0;
|
||||
|
||||
if (!strncmp(argv[idx_type]->arg, "table", 5))
|
||||
if (!strcmp(argv[idx_type]->text, "table"))
|
||||
level = OSPF6_DEBUG_ROUTE_TABLE;
|
||||
else if (!strncmp(argv[idx_type]->arg, "intra", 5))
|
||||
else if (!strcmp(argv[idx_type]->text, "intra-area"))
|
||||
level = OSPF6_DEBUG_ROUTE_INTRA;
|
||||
else if (!strncmp(argv[idx_type]->arg, "inter", 5))
|
||||
else if (!strcmp(argv[idx_type]->text, "inter-area"))
|
||||
level = OSPF6_DEBUG_ROUTE_INTER;
|
||||
else if (!strncmp(argv[idx_type]->arg, "memor", 5))
|
||||
else if (!strcmp(argv[idx_type]->text, "memory"))
|
||||
level = OSPF6_DEBUG_ROUTE_MEMORY;
|
||||
OSPF6_DEBUG_ROUTE_OFF(level);
|
||||
return CMD_SUCCESS;
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user