]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: Fix crash in 'no vrf' command
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 13 May 2016 12:24:50 +0000 (12:24 +0000)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 13 May 2016 14:32:04 +0000 (10:32 -0400)
If a routing protocol does not have a vrf
configed and the vrf happens to be down
a 'no vrf X' line will cause the system
to crash.

This fixes the issue, I do believe though
that we need to revisit the issue and re-think
start/stop/config/unconfig of vrf's a bit more.

Ticket: CM-10952
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
lib/zclient.c

index 35a5b9e857877319df81962822b98d2cfc69db55..d86b576c1b45b43de71968d08411929ac60c67c8 100644 (file)
@@ -974,6 +974,14 @@ zclient_vrf_delete (struct stream *s, vrf_id_t vrf_id)
   /* Lookup vrf by vrf_id. */
   vrf = vrf_lookup (vrf_id);
 
+  /*
+   * If a routing protocol doesn't know about a
+   * vrf that is about to be deleted.  There is
+   * no point in attempting to delete it.
+   */
+  if (!vrf)
+    return;
+
   vrf_delete (vrf);
 }