]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Fix crash when looking up incoming interface
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 14 Jun 2017 22:45:47 +0000 (18:45 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 24 Jul 2017 17:51:39 +0000 (13:51 -0400)
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>
pimd/pim_pim.c

index 5bfe9c4f1f63d4a37fdb5b2280ed0368d9e445cc..ffe5d52a156f052d7183da7c1ee85ba1a2fd454e 100644 (file)
@@ -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);