]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd: Fix oi->nbr_self pointer dereference
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 10 Jun 2016 18:32:22 +0000 (14:32 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 10 Jun 2016 19:08:28 +0000 (15:08 -0400)
With commit 1b31375427008aaf980f68d95f50007f600c8ae1
we have a situation where it is possible that the
oi->nbr_self has not been properly set.  When
calling the function that sets the nbr_self data
make sure that we have a pointer that works for it.

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

index 46fcc6ba2f0dbbd91308434c163806cf7bb160b1..16753b85dfe6ce55624198a12bb0bed4326cb12f 100644 (file)
@@ -254,6 +254,9 @@ ospf_nbr_add_self (struct ospf_interface *oi)
   struct prefix p;
   struct route_node *rn;
 
+  if (!oi->nbr_self)
+    oi->nbr_self = ospf_nbr_new (oi);
+
   /* Initial state */
   oi->nbr_self->address = *oi->address;
   oi->nbr_self->priority = OSPF_IF_PARAM (oi, priority);