[quagga-dev 3902] Re: [quagga-users 5988] Annoying bug (or misconfiguration) in ospfd

Len Sorensen lennartsorensen at ruggedcom.com
Thu Dec 22 21:27:17 GMT 2005


Well I have some news on the OSPF issue in bug #234.

The included patch so far appears to solve the problem.

The problem seems to be in the handling of the InterfaceDown event,
which I assume only happens when you have link detect enabled in zebra
(which we do, and we run linux so it works).

It appears that when the interface goes down, an event triggers which
then wipes out the nbrs list and deletes the nbr_self and creates a new
one.  Unfortunately it doesn't quite do the same list of steps as was
initially done to populate the nbr_self and nbrs for the oi.  My patch I
believe makes it do the missing steps.

I have also removed changing the d_router and bd_router fields in the
nbr list, since I believe those values should only be populated based on
the hello packets received.

It also fixed a couple if typos in a comment.

The patch is made against 0.98.5 (if the lines are a bit offset it is
because I also have the 'passive-interface default' patch applied).

Len Sorensen

diff -ruN quagga-0.98.5.rr1/ospfd/ospf_interface.c quagga-0.98.5.rr2.rc1/ospfd/ospf_interface.c
--- quagga-0.98.5.rr1/ospfd/ospf_interface.c	2005-12-21 16:17:49.000000000 -0500
+++ quagga-0.98.5.rr2.rc1/ospfd/ospf_interface.c	2005-12-21 16:00:34.000000000 -0500
@@ -267,7 +267,7 @@
   struct listnode *node;
   struct ospf_neighbor *nbr;
 
-  /* oi->nbrs and oi->nbr_nbma should be deletete on InterafceDown event */
+  /* oi->nbrs and oi->nbr_nbma should be deleted on InterfaceDown event */
   /* delete all static neighbors attached to this interface */
   for (node = listhead (oi->nbr_nbma); node; )
     {
@@ -303,12 +303,22 @@
   /* Empty link state update queue */
   ospf_ls_upd_queue_empty (oi);
   
- /* Handle pseudo neighbor. */
+  /* Handle pseudo neighbor. */
   ospf_nbr_delete (oi->nbr_self);
   oi->nbr_self = ospf_nbr_new (oi);
   oi->nbr_self->state = NSM_TwoWay;
   oi->nbr_self->priority = OSPF_IF_PARAM (oi, priority);
 
+  /* Set address in nbr */
+  oi->nbr_self->address = *oi->address;
+
+  /* Add pseudo neighbor. */
+  ospf_nbr_add_self (oi);
+
+  /* Make sure pseudo neighbor's router_id. */
+  oi->nbr_self->router_id = oi->ospf->router_id;
+  oi->nbr_self->src = oi->address->u.prefix4;
+
   switch (oi->area->external_routing)
     {
     case OSPF_AREA_DEFAULT:
diff -ruN quagga-0.98.5.rr1/ospfd/ospf_ism.c quagga-0.98.5.rr2.rc1/ospfd/ospf_ism.c
--- quagga-0.98.5.rr1/ospfd/ospf_ism.c	2004-12-08 12:52:03.000000000 -0500
+++ quagga-0.98.5.rr2.rc1/ospfd/ospf_ism.c	2005-12-21 16:04:21.000000000 -0500
@@ -105,7 +105,6 @@
   if (dr)
     {
       DR (oi) = dr->address.u.prefix4;
-      dr->d_router = dr->address.u.prefix4;
     }
   else
       DR (oi).s_addr = 0;
@@ -151,7 +150,6 @@
   if (bdr)
     {
       BDR (oi) = bdr->address.u.prefix4;
-      bdr->bd_router = bdr->address.u.prefix4;
     }
   else
     BDR (oi).s_addr = 0;



More information about the Quagga-dev mailing list