From 2e2c69817ab0755cc3b0839566b9bf95e41ab558 Mon Sep 17 00:00:00 2001 From: saravanank Date: Tue, 17 Mar 2020 21:39:05 -0700 Subject: [PATCH] pimd: crash while finding primary address. RCA: Trying to get primary address for the interface. Unnumbered interface pick address from vrf device for non default. While doing so it ends up in recursion without exit condition if vrf dev doesnt have any address. Solution: Break the recursion by checking if it is vrf device. Signed-off-by: Saravanan K --- pimd/pim_iface.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c index cb31878e0151..6a2b28229513 100644 --- a/pimd/pim_iface.c +++ b/pimd/pim_iface.c @@ -894,8 +894,10 @@ struct in_addr pim_find_primary_addr(struct interface *ifp) * So let's grab the loopbacks v4 address * and use that as the primary address */ - if (!v4_addrs && v6_addrs && !if_is_loopback(ifp)) { + if (!v4_addrs && v6_addrs && !if_is_loopback(ifp) && + !pim_if_is_vrf_device(ifp)) { struct interface *lo_ifp; + // DBS - Come back and check here if (ifp->vrf_id == VRF_DEFAULT) lo_ifp = if_lookup_by_name("lo", vrf->vrf_id);