diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-06-14 18:45:47 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-07-24 13:51:39 -0400 |
| commit | 05d8470ff58c62bc67658aa66435ac69f404b51b (patch) | |
| tree | 12308a95b7677f9f068c4c07d9cc29c98c4c0012 | |
| parent | b5f3a428f25ac0dedbca0869a232f217d7e3acce (diff) | |
pimd: Fix crash when looking up incoming interface
It is possible that the incoming interface lookup
will fail because we are in transition from one vrf
to another.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| -rw-r--r-- | pimd/pim_pim.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c index 5bfe9c4f1f..ffe5d52a15 100644 --- a/pimd/pim_pim.c +++ b/pimd/pim_pim.c @@ -327,11 +327,11 @@ static int pim_sock_read(struct thread *t) * it's the right interface because we bind to it */ ifp = if_lookup_by_index(ifindex, pim_ifp->pim->vrf_id); - if (!ifp->info) { + if (!ifp || !ifp->info) { if (PIM_DEBUG_PIM_PACKETS) zlog_debug( - "%s: Received incoming pim packet on interface not yet configured for pim %s", - __PRETTY_FUNCTION__, ifp->name); + "%s: Received incoming pim packet on interface not yet configured for pim", + __PRETTY_FUNCTION__); goto done; } int fail = pim_pim_packet(ifp, buf, len); |
