summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>2009-11-29 11:08:40 +0000
committerDavid Lamparter <equinox@diac24.net>2010-02-04 02:20:41 +0100
commite0abb221e1f5c1d6f94dd5969f8f129cc3a4a9e8 (patch)
tree62d7f44b49cf61364b55ad8387e0e0481848a9ee
parent25340c0f97797e51c643b7bb4fa1f70c4a04ca4c (diff)
downloadquagga-e0abb221e1f5c1d6f94dd5969f8f129cc3a4a9e8.tar.bz2
quagga-e0abb221e1f5c1d6f94dd5969f8f129cc3a4a9e8.tar.xz
ospfd: PointToPoint neighbors are identified by router ID.
According to RFC 2328, section 10.5 PointToPoint neighbors should be identified by router ID instead of source IP address.
-rw-r--r--ospfd/ospf_neighbor.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ospfd/ospf_neighbor.c b/ospfd/ospf_neighbor.c
index b0517ff4..2b7ca08d 100644
--- a/ospfd/ospf_neighbor.c
+++ b/ospfd/ospf_neighbor.c
@@ -125,7 +125,7 @@ ospf_nbr_free (struct 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
+ * 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);