On Thu, Jul 26, 2012 at 09:46:02AM +0200, [email protected] wrote:
> Hello
> Problem is in both cases: when bird starts and when it's reconfigured.
>
> When bird starts log is:
> <TRACE> MyOSPF: Flushing AS-external-LSA for 0.0.0.0/0
> <TRACE> MyOSPF: Premature aging self originated lsa!
> <TRACE> MyOSPF: Type: 0005, Id: 0.0.0.0, Rt: 172.0.0.1
> <TRACE> MyOSPF: Flushing AS-external-LSA for 0.0.0.0/0
> <TRACE> MyOSPF: Premature aging self originated lsa!
> <TRACE> MyOSPF: Type: 0005, Id: 0.0.0.0, Rt: 172.0.0.1
>
> I post configuration after I configure area 10 to nssa. Problem is when  
> area 10 is normal area.

Hello, it is a bug. Attached patch should fix that.

-- 
Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: [email protected])
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c
index ef7b036..aa62da1 100644
--- a/proto/ospf/ospf.c
+++ b/proto/ospf/ospf.c
@@ -575,7 +575,7 @@ ospf_rt_notify(struct proto *p, rtable *tbl UNUSED, net * n, rte * new, rte * ol
     if (fn->x1 != EXT_EXPORT)
       return;
 
-    flush_ext_lsa(oa, fn);
+    flush_ext_lsa(oa, fn, oa_is_nssa(oa));
 
     /* Old external route might blocked some NSSA translation */
     if (po->areano > 1)
diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c
index 42c54df..4b8de4b 100644
--- a/proto/ospf/rt.c
+++ b/proto/ospf/rt.c
@@ -1066,7 +1066,7 @@ check_nssa_lsa(struct proto_ospf *po, ort *nf)
     originate_ext_lsa(po->backbone, fn, EXT_NSSA, rt_metric, rt_fwaddr, rt_tag, 0);
 
   else if (fn->x1 == EXT_NSSA)
-    flush_ext_lsa(po->backbone, fn);
+    flush_ext_lsa(po->backbone, fn, 0);
 }
 
 /* RFC 2328 16.7. p2 - find new/lost vlink endpoints */
@@ -1189,7 +1189,7 @@ ospf_rt_abr1(struct proto_ospf *po)
     if (oa_is_nssa(oa) && oa->ac->default_nssa)
       originate_ext_lsa(oa, &default_nf->fn, 0, oa->ac->default_cost, IPA_NONE, 0, 0);
     else
-      flush_ext_lsa(oa, &default_nf->fn);
+      flush_ext_lsa(oa, &default_nf->fn, 1);
 
 
     /* RFC 2328 16.4. (3) - precompute preferred ASBR entries */
diff --git a/proto/ospf/topology.c b/proto/ospf/topology.c
index 7e9bad5..ec012b2 100644
--- a/proto/ospf/topology.c
+++ b/proto/ospf/topology.c
@@ -862,6 +862,9 @@ flush_sum_lsa(struct ospf_area *oa, struct fib_node *fn, int type)
 
   if ((en = ospf_hash_find_header(po->gr, oa->areaid, &lsa)) != NULL)
     {
+      OSPF_TRACE(D_EVENTS, "Flushing summary-LSA (id=%R, type=%d)",
+		 en->lsa.id, en->lsa.type);
+
       if ((type == ORT_NET) && check_sum_net_lsaid_collision(fn, en))
 	{
 	  log(L_ERR "%s: LSAID collision for %I/%d",
@@ -873,9 +876,6 @@ flush_sum_lsa(struct ospf_area *oa, struct fib_node *fn, int type)
       en->lsa.age = LSA_MAXAGE;
       en->lsa.sn = LSA_MAXSEQNO;
       lsasum_calculate(&en->lsa, sum);
-
-      OSPF_TRACE(D_EVENTS, "Flushing summary-LSA (id=%R, type=%d)",
-		 en->lsa.id, en->lsa.type);
       ospf_lsupd_flood(po, NULL, NULL, &en->lsa, oa->areaid, 1);
       if (can_flush_lsa(po)) flush_lsa(en, po);
     }
@@ -1131,15 +1131,11 @@ originate_ext_lsa(struct ospf_area *oa, struct fib_node *fn, int src,
 }
 
 void
-flush_ext_lsa(struct ospf_area *oa, struct fib_node *fn)
+flush_ext_lsa(struct ospf_area *oa, struct fib_node *fn, int nssa)
 {
   struct proto_ospf *po = oa->po;
   struct proto *p = &po->proto;
   struct top_hash_entry *en;
-  int nssa = oa_is_nssa(oa);
-
-  OSPF_TRACE(D_EVENTS, "Flushing %s-LSA for %I/%d",
-	     nssa ? "NSSA" : "AS-external", fn->prefix, fn->pxlen);
 
   u32 dom = nssa ? oa->areaid : 0;
   u32 type = nssa ? LSA_T_NSSA : LSA_T_EXT;
@@ -1147,6 +1143,9 @@ flush_ext_lsa(struct ospf_area *oa, struct fib_node *fn)
 
   if (en = ospf_hash_find(po->gr, dom, lsaid, po->router_id, type))
     {
+      OSPF_TRACE(D_EVENTS, "Flushing %s-LSA for %I/%d",
+		 nssa ? "NSSA" : "AS-external", fn->prefix, fn->pxlen);
+
       if (check_ext_lsa(en, fn, 0, IPA_NONE, 0) < 0)
 	{
 	  log(L_ERR "%s: LSAID collision for %I/%d",
diff --git a/proto/ospf/topology.h b/proto/ospf/topology.h
index b9bc9cf..cb87648 100644
--- a/proto/ospf/topology.h
+++ b/proto/ospf/topology.h
@@ -72,7 +72,7 @@ void originate_sum_net_lsa(struct ospf_area *oa, struct fib_node *fn, int metric
 void originate_sum_rt_lsa(struct ospf_area *oa, struct fib_node *fn, int metric, u32 options UNUSED);
 void flush_sum_lsa(struct ospf_area *oa, struct fib_node *fn, int type);
 void originate_ext_lsa(struct ospf_area *oa, struct fib_node *fn, int src, u32 metric, ip_addr fwaddr, u32 tag, int pbit);
-void flush_ext_lsa(struct ospf_area *oa, struct fib_node *fn);
+void flush_ext_lsa(struct ospf_area *oa, struct fib_node *fn, int nssa);
 
 
 #ifdef OSPFv2

Reply via email to