Skip to content

Commit

Permalink
pimd: crash while finding primary address.
Browse files Browse the repository at this point in the history
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 <saravanank@vmware.com>
  • Loading branch information
sarav511 committed Mar 18, 2020
1 parent 7f2ccbe commit 2e2c698
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pimd/pim_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2e2c698

Please sign in to comment.