[quagga-dev 7433] [PATCH 5/5] ospfd: PointToPoint neighbors are identified by router ID.

Joakim Tjernlund Joakim.Tjernlund at transmode.se
Sun Nov 29 12:08:40 GMT 2009


According to RFC 2328, section 10.5  PointToPoint neighbors
should be identified by router ID instead of source IP address.
---
 ospfd/ospf_neighbor.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/ospfd/ospf_neighbor.c b/ospfd/ospf_neighbor.c
index c33ac05..2b7ca08 100644
--- a/ospfd/ospf_neighbor.c
+++ b/ospfd/ospf_neighbor.c
@@ -124,8 +124,8 @@ ospf_nbr_free (struct ospf_neighbor *nbr)
   XFREE (MTYPE_OSPF_NEIGHBOR, nbr);
 }
 /* lookup nbr by address - use this only if you know you must
- * otherwise use the ospf_nbr_lookup() wrapper, which deals 
- * with virtual link neighbours
+ * otherwise use the ospf_nbr_lookup() wrapper, which deals
+ * with virtual link and PointToPoint neighbours
  */
 struct ospf_neighbor *
 ospf_nbr_lookup_by_addr (struct list *nbrs,
@@ -208,7 +208,8 @@ ospf_nbr_add_self (struct ospf_interface *oi)
     }
 
   /* Sanity check, should not be needed */
-  if (oi->type == OSPF_IFTYPE_VIRTUALLINK)
+  if (oi->type == OSPF_IFTYPE_VIRTUALLINK ||
+      oi->type == OSPF_IFTYPE_POINTOPOINT)
     nbr = ospf_nbr_lookup_by_routerid (oi->nbrs, &oi->nbr_self->router_id);
   else
     nbr = ospf_nbr_lookup_by_addr (oi->nbrs, &oi->nbr_self->src);
@@ -295,7 +296,8 @@ struct ospf_neighbor *
 ospf_nbr_lookup (struct ospf_interface *oi, struct ip *iph,
                  struct ospf_header *ospfh)
 {
-  if (oi->type == OSPF_IFTYPE_VIRTUALLINK)
+  if (oi->type == OSPF_IFTYPE_VIRTUALLINK ||
+      oi->type == OSPF_IFTYPE_POINTOPOINT)
     return ospf_nbr_lookup_by_routerid (oi->nbrs, &ospfh->router_id);
   else
     return ospf_nbr_lookup_by_addr (oi->nbrs, &iph->ip_src);
-- 
1.6.4.4




More information about the Quagga-dev mailing list