On Fri, 4 Sep 2015, Paul Jakma wrote:
That's interesting. It's likely the bug is not in this patch,
Ah no, it's just a silly bug in that patch. Right idea though, but needed
another line (which can then be wrapped up in helper function - there's
one other place that resets nbr_self too).
Attached should fix.
regards,
--
Paul Jakma [email protected] @pjakma Key ID: 64A2FF6A
Fortune:
The chicken that clucks the loudest is the one most likely to show up
at the steam fitters' picnic.
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index 07c3fe3..af4f0a6 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -295,9 +295,7 @@ ospf_if_cleanup (struct ospf_interface *oi)
ospf_ls_upd_queue_empty (oi);
/* Reset pseudo neighbor. */
- ospf_nbr_delete (oi->nbr_self);
- oi->nbr_self = ospf_nbr_new (oi);
- ospf_nbr_add_self (oi);
+ ospf_nbr_self_reset (oi);
}
void
diff --git a/ospfd/ospf_neighbor.c b/ospfd/ospf_neighbor.c
index 967ca15..c3bdf99 100644
--- a/ospfd/ospf_neighbor.c
+++ b/ospfd/ospf_neighbor.c
@@ -202,6 +202,15 @@ ospf_nbr_bidirectional (struct in_addr *router_id,
return 0;
}
+/* reset nbr_self */
+void
+ospf_nbr_self_reset (struct ospf_interface *oi)
+{
+ ospf_nbr_delete (oi->nbr_self);
+ oi->nbr_self = ospf_nbr_new (oi);
+ ospf_nbr_add_self (oi);
+}
+
/* Add self to nbr list. */
void
ospf_nbr_add_self (struct ospf_interface *oi)
diff --git a/ospfd/ospf_neighbor.h b/ospfd/ospf_neighbor.h
index 25f1352..822c202 100644
--- a/ospfd/ospf_neighbor.h
+++ b/ospfd/ospf_neighbor.h
@@ -99,6 +99,7 @@ extern struct ospf_neighbor *ospf_nbr_new (struct
ospf_interface *);
extern void ospf_nbr_free (struct ospf_neighbor *);
extern void ospf_nbr_delete (struct ospf_neighbor *);
extern int ospf_nbr_bidirectional (struct in_addr *, struct in_addr *, int);
+extern void ospf_nbr_self_reset (struct ospf_interface *);
extern void ospf_nbr_add_self (struct ospf_interface *);
extern int ospf_nbr_count (struct ospf_interface *, int);
#ifdef HAVE_OPAQUE_LSA
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c
index 019a22b..1a549c3 100644
--- a/ospfd/ospfd.c
+++ b/ospfd/ospfd.c
@@ -118,8 +118,7 @@ ospf_router_id_update (struct ospf *ospf)
* oi->nbr_self->router_id = router_id for
* !(virtual | ptop) links
*/
- ospf_nbr_delete(oi->nbr_self);
- ospf_nbr_add_self(oi);
+ ospf_nbr_self_reset (oi);
}
/* If AS-external-LSA is queued, then flush those LSAs. */
_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev