summaryrefslogtreecommitdiffstats
path: root/zebra/debug.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2017-05-04 04:49:50 +0200
committerRenato Westphal <renato@opensourcerouting.org>2017-05-04 19:39:58 +0200
commit313605cb92d0d7815eb1f5d7057e455c94e91c96 (patch)
treec1d9a93662bf1848321faf3807916d4f99e33155 /zebra/debug.c
parentMerge pull request #450 from donaldsharp/afi_safi3 (diff)
downloadfrr-313605cb92d0d7815eb1f5d7057e455c94e91c96.tar.xz
frr-313605cb92d0d7815eb1f5d7057e455c94e91c96.zip
*: fix a bunch of segfaults detected by a CLI fuzzer
This patch fixes the following segfaults: zebra aborted: vtysh -c "show ipv6 mroute" zebra aborted: vtysh -c "configure terminal" -c "debug zebra kernel msgdump" zebra aborted: vtysh -c "configure terminal" -c "interface eth99" -c "link-params" -c "no packet-loss" zebra aborted: vtysh -c "configure terminal" -c "interface eth99" -c "link-params" -c "no metric" zebra aborted: vtysh -c "configure terminal" -c "interface eth99" -c "link-params" -c "no ava-bw" zebra aborted: vtysh -c "configure terminal" -c "interface eth99" -c "link-params" -c "no res-bw" zebra aborted: vtysh -c "configure terminal" -c "interface eth99" -c "link-params" -c "no use-bw" ospfd aborted: vtysh -c "configure terminal" -c "router ospf" -c "area 1.1.1.1 nssa" ospfd aborted: vtysh -c "configure terminal" -c "router ospf" -c "area 4294967295 nssa" pimd aborted: vtysh -c "show ip msdp sa 1.1.1.1" pimd aborted: vtysh -c "configure terminal" -c "ip ssmpingd" pimd aborted: vtysh -c "configure terminal" -c "no ip ssmpingd" pimd aborted: vtysh -c "configure terminal" -c "no ip msdp mesh-group WORD source" pimd aborted: vtysh -c "configure terminal" -c "interface eth99" -c "ip pim hello 180" bgpd aborted: vtysh -c "show bgp l2vpn evpn rd 1:1" bgpd aborted: vtysh -c "clear vnc nve un *" bgpd aborted: vtysh -c "clear vnc nve un 1.1.1.1" bgpd aborted: vtysh -c "clear vnc nve un 2001:db8::1" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 1.1.1.1 lifetime 4294967295" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 1.1.1.1 cost 255 lifetime 4294967295" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 1.1.1.1 cost 255" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 1.1.1.1" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 2001:db8::1 lifetime 4294967295" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 2001:db8::1 cost 255 lifetime 4294967295" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 2001:db8::1 cost 255" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 2001:db8::1" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 1.1.1.1 lifetime 4294967295" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 1.1.1.1 cost 255 lifetime 4294967295" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 1.1.1.1 cost 255" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 1.1.1.1" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 2001:db8::1 lifetime 4294967295" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 2001:db8::1 cost 255 lifetime 4294967295" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 2001:db8::1 cost 255" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 2001:db8::1" bgpd aborted: vtysh -c "configure terminal" -c "router bgp 1" -c "no vnc export bgp ipv4 prefix-list NAME" bgpd aborted: vtysh -c "configure terminal" -c "router bgp 1" -c "no vnc export bgp ipv6 prefix-list NAME" bgpd aborted: vtysh -c "configure terminal" -c "router bgp 1" -c "no vnc export bgp route-map NAME" bgpd aborted: vtysh -c "configure terminal" -c "router bgp 1" -c "no vnc export zebra ipv4 prefix-list NAME" bgpd aborted: vtysh -c "configure terminal" -c "router bgp 1" -c "no vnc export zebra ipv6 prefix-list NAME" bgpd aborted: vtysh -c "configure terminal" -c "router bgp 1" -c "no vnc export zebra route-map NAME" bgpd aborted: vtysh -c "configure terminal" -c "route-map RMAP permit 1" -c "no set ipv6 vpn next-hop" bgpd aborted: vtysh -c "configure terminal" -c "route-map RMAP permit 1" -c "set vpnv4 next-hop" bgpd aborted: vtysh -c "configure terminal" -c "route-map RMAP permit 1" -c "set vpnv6 next-hop" bgpd aborted: vtysh -c "configure terminal" -c "router bgp" -c "address-family ipv6 vpn" -c "network 2001:db8::1/128 rd 1:1 tag WORD" bgpd aborted: vtysh -c "configure terminal" -c "router bgp" -c "address-family vpnv6 unicast" -c "network 2001:db8::1/128 rd 1:1 tag WORD" bgpd aborted: vtysh -c "configure terminal" -c "router bgp" -c "no neighbor WORD shutdown message MSG..." bgpd aborted: vtysh -c "configure terminal" -c "router bgp" -c "neighbor WORD shutdown message MSG..." More to come later. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'zebra/debug.c')
-rw-r--r--zebra/debug.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/zebra/debug.c b/zebra/debug.c
index f21778276..a42d5aa3e 100644
--- a/zebra/debug.c
+++ b/zebra/debug.c
@@ -173,11 +173,12 @@ DEFUN (debug_zebra_kernel_msgdump,
"Dump raw netlink messages received\n"
"Dump raw netlink messages sent\n")
{
- int idx_recv_send = 4;
- if (argv[idx_recv_send]->arg && strncmp(argv[idx_recv_send]->arg, "recv", strlen(argv[idx_recv_send]->arg)) == 0)
+ int idx = 0;
+ if (argc == 4 || argv_find (argv, argc, "recv", &idx))
SET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV);
- if (!argv[idx_recv_send]->arg || strncmp(argv[idx_recv_send]->arg, "send", strlen(argv[idx_recv_send]->arg)) == 0)
+ if (argc == 4 || argv_find (argv, argc, "send", &idx))
SET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND);
+
return CMD_SUCCESS;
}