]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
A partial vlink fix.
authorOndrej Zajicek <santiago@crfreenet.org>
Fri, 8 Jan 2010 21:19:41 +0000 (22:19 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Fri, 8 Jan 2010 21:19:41 +0000 (22:19 +0100)
proto/ospf/iface.c
proto/ospf/packet.c
proto/ospf/rt.c

index e6ae91bdce361257c8febdf9940699c7b95f7d8e..25a982240f73a8b1e1a1099f697b4ad96bb221ff 100644 (file)
@@ -69,8 +69,11 @@ ospf_open_socket(struct ospf_iface *ifa, int mc)
   ipsk->dport = OSPF_PROTO;
 
 #ifdef OSPFv2
-  //  ipsk->saddr = ifa->iface->addr->ip;
-  ipsk->saddr = IPA_NONE;
+  /* FIXME - why there is IPA_NONE on multicast sockets ? */
+  if (mc)
+    ipsk->saddr = IPA_NONE;
+  else
+    ipsk->saddr = ifa->iface->addr->ip;
 #else /* OSPFv3 */
   ipsk->saddr = ifa->lladdr;
 #endif
index 1a02c00eb950599d8128b4e97d8d332e36f64baf..ce9739e0ccde89f5e67e8b3beb0211ab2f73af24 100644 (file)
@@ -287,7 +287,7 @@ ospf_rx_hook(sock * sk, int size)
     return 1;
   }
 
-  /* This is strange! */
+  /* We receive packets related to vlinks even on non-vlink sockets */
   if ((ifa->oa->areaid != 0) && (ntohl(ps->areaid) == 0))
   {
     WALK_LIST(iff, po->iface_list)
index 31a6a1fd833dd69176924d64c6725bb37aa4abbc..8b88d6638cd0dbf20cde3c8b21fedb4dfe3c241e 100644 (file)
@@ -310,6 +310,7 @@ ospf_rt_spfa_rtlinks(struct ospf_area *oa, struct top_hash_entry *act, struct to
     }
 }
 
+/* 16.1 calculating shortest paths for an area */
 static void
 ospf_rt_spfa(struct ospf_area *oa)
 {
@@ -510,6 +511,7 @@ link_back(struct ospf_area *oa, struct top_hash_entry *en, struct top_hash_entry
   return 0;
 }
 
+/* 16.3 examining summary-LSAs in transit areas */
 static void
 ospf_rt_sum_tr(struct ospf_area *oa)
 {
@@ -533,12 +535,14 @@ ospf_rt_sum_tr(struct ospf_area *oa)
     if (en->domain != oa->areaid)
       continue;
 
+    /* 16.3 (1a) */
     if (en->lsa.age == LSA_MAXAGE)
       continue;
 
-    if (en->dist == LSINFINITY)
-      continue;
+    // if (en->dist == LSINFINITY)
+    //   continue;
 
+    /* 16.3 (2) */
     if (en->lsa.rt == po->router_id)
       continue;
 
@@ -583,12 +587,17 @@ ospf_rt_sum_tr(struct ospf_area *oa)
       re = (ort *) fib_find(&bb->rtr, &ip, pxlen);
     }
 
+    /* 16.3 (1b) */ 
+    if (metric == LSINFINITY) 
+      continue; 
+
+    /* 16.3 (3) */
     if (!re) continue;
     if (re->n.oa->areaid != 0) continue;
     if ((re->n.type != RTS_OSPF) && (re->n.type != RTS_OSPF_IA)) continue;
 
+    /* 16.3. (4) */
     abrip = ipa_from_rid(en->lsa.rt);
-
     abr = fib_find(&oa->rtr, &abrip, MAX_PREFIX_LENGTH);
     if (!abr) continue;
 
@@ -605,7 +614,7 @@ ospf_rt_sum_tr(struct ospf_area *oa)
   }
 }
   
-
+/* 16.2 calculating inter-area routes */
 static void
 ospf_rt_sum(struct ospf_area *oa)
 {