From: Chirag Shah Date: Thu, 4 May 2017 01:56:44 +0000 (-0700) Subject: pimd: fix pimd crash when pim interface disabled X-Git-Tag: frr-3.0-rc0~43^2~2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=9ab028b26daeeb180e2d38489c118ea119ec643d;p=mirror%2Ffrr.git pimd: fix pimd crash when pim interface disabled Upon pim enabled disabled, current upstreams entries rpf update callback, needs to check if old rpf is still pim enabled otherwise do not trigger prune towards old rpf. Testing Done: Verified by disabling pim enabled rpf interface and crash is not observed upon disabling pim on rpf interface. Signed-off-by: Chirag Shah --- diff --git a/pimd/pim_jp_agg.c b/pimd/pim_jp_agg.c index ce4ddfd4a4..bbc51bd91c 100644 --- a/pimd/pim_jp_agg.c +++ b/pimd/pim_jp_agg.c @@ -127,6 +127,10 @@ pim_jp_agg_get_interface_upstream_switch_list (struct pim_rpf *rpf) struct pim_iface_upstream_switch *pius; struct listnode *node, *nnode; + /* Old interface is pim disabled */ + if (!pim_ifp) + return NULL; + for (ALL_LIST_ELEMENTS(pim_ifp->upstream_switch_list, node, nnode, pius)) { if (pius->address.s_addr == rpf->rpf_addr.u.prefix4.s_addr) @@ -323,7 +327,8 @@ pim_jp_agg_switch_interface (struct pim_rpf *orpf, */ /* send Prune(S,G) to the old upstream neighbor */ - pim_jp_agg_add_group (opius->us, up, false); + if (opius) + pim_jp_agg_add_group (opius->us, up, false); /* send Join(S,G) to the current upstream neighbor */ pim_jp_agg_add_group (npius->us, up, true);