]> git.proxmox.com Git - mirror_frr.git/commitdiff
eigrpd: On creation of socket ensure vrf exists
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 25 Sep 2019 00:48:10 +0000 (20:48 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 25 Sep 2019 13:26:24 +0000 (09:26 -0400)
If the vrf does not exist, politely do not create
the socket.

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

index c7ffbf9f0eb4489fc7f43047c06f2aab26656152..3e09ec41bbc8c3e7e86207ab5a68505c73cf0e75 100644 (file)
@@ -55,12 +55,15 @@ static void eigrp_network_run_interface(struct eigrp *, struct prefix *,
 
 int eigrp_sock_init(struct vrf *vrf)
 {
-       int eigrp_sock;
+       int eigrp_sock = -1;
        int ret;
 #ifdef IP_HDRINCL
        int hincl = 1;
 #endif
 
+       if (!vrf)
+               return eigrp_sock;
+
        frr_with_privs(&eigrpd_privs) {
                eigrp_sock = vrf_socket(
                        AF_INET, SOCK_RAW, IPPROTO_EIGRPIGP, vrf->vrf_id,