]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Wisely delay startup of msdp listen/connect when vrf is not fully up
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 14 Jun 2017 23:59:02 +0000 (19:59 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 24 Jul 2017 17:51:40 +0000 (13:51 -0400)
When we do not really have the vrf up, wisely do not attempt
to dereference the ifp looked up.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_msdp_socket.c

index b8c103fe276a8c452b680e92d7af1f117d187312..9473462e6325ed08db0400d4266b41f0e970e7bb 100644 (file)
@@ -153,6 +153,11 @@ int pim_msdp_sock_listen(struct pim_instance *pim)
        if (pim->vrf_id != VRF_DEFAULT) {
                struct interface *ifp =
                        if_lookup_by_name(pim->vrf->name, pim->vrf_id);
+               if (!ifp) {
+                       zlog_err("%s: Unable to lookup vrf interface: %s",
+                                __PRETTY_FUNCTION__, pim->vrf->name);
+                       return -1;
+               }
                pim_socket_bind(sock, ifp);
        }
 
@@ -226,6 +231,11 @@ int pim_msdp_sock_connect(struct pim_msdp_peer *mp)
        if (mp->pim->vrf_id != VRF_DEFAULT) {
                struct interface *ifp =
                        if_lookup_by_name(mp->pim->vrf->name, mp->pim->vrf_id);
+               if (!ifp) {
+                       zlog_err("%s: Unable to lookup vrf interface: %s",
+                                __PRETTY_FUNCTION__, mp->pim->vrf->name);
+                       return -1;
+               }
                pim_socket_bind(mp->fd, ifp);
        }