summaryrefslogtreecommitdiffstats
path: root/eigrpd/eigrp_network.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-09-25 02:48:10 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-09-25 15:26:24 +0200
commit38513e880e789680c4a8590fcb1a99d260aa534f (patch)
tree37cfc3848f081afae42a51a2b8974bf663e9f2a1 /eigrpd/eigrp_network.c
parentospf6d: Prevent use after free (diff)
downloadfrr-38513e880e789680c4a8590fcb1a99d260aa534f.tar.xz
frr-38513e880e789680c4a8590fcb1a99d260aa534f.zip
eigrpd: On creation of socket ensure vrf exists
If the vrf does not exist, politely do not create the socket. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'eigrpd/eigrp_network.c')
-rw-r--r--eigrpd/eigrp_network.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/eigrpd/eigrp_network.c b/eigrpd/eigrp_network.c
index c7ffbf9f0..3e09ec41b 100644
--- a/eigrpd/eigrp_network.c
+++ b/eigrpd/eigrp_network.c
@@ -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,