diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2009-03-29 19:34:24 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2009-03-29 19:34:24 +0000 |
commit | 04af3fc952d56b36ca09933d04cc4ae9836fe11a (patch) | |
tree | 713ae4a4c7659c67fbc23912de8dbed01c4365a7 /usr.sbin/ospf6d | |
parent | 68e74bdf6908f3b8e20436865afa98df9fe89f9f (diff) |
Update linked() for OSPFv3.
A router vertex w has a point-to-point link back to a router
vertex v if v's router ID occurs as neighbour ID in one of the
point-to-point links described in w's router LSA.
A router vertex w has a link back to a network vertex v if the router
ID of v's advertising router (i.e. DR) occurs as neighbour ID in one
of the transit links described in w's router LSA, and v's interface
ID to the network matches the neighbour interface ID of that transit
link.
A network vertex w has a link back to a router vertex v if v's router
ID occurs in the list of attached routers in w's network LSA.
Also, get_rtr_link() and get_net_link() take an unsigned int now.
"commit it" claudio@
Diffstat (limited to 'usr.sbin/ospf6d')
-rw-r--r-- | usr.sbin/ospf6d/rde_spf.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/usr.sbin/ospf6d/rde_spf.c b/usr.sbin/ospf6d/rde_spf.c index 755adb77c14..2640bc093db 100644 --- a/usr.sbin/ospf6d/rde_spf.c +++ b/usr.sbin/ospf6d/rde_spf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_spf.c,v 1.9 2009/03/29 19:28:10 stsp Exp $ */ +/* $OpenBSD: rde_spf.c,v 1.10 2009/03/29 19:34:23 stsp Exp $ */ /* * Copyright (c) 2005 Esben Norby <norby@openbsd.org> @@ -1038,7 +1038,7 @@ linked(struct vertex *w, struct vertex *v) { struct lsa_rtr_link *rtr_link = NULL; struct lsa_net_link *net_link = NULL; - int i; + unsigned int i; switch (w->type) { case LSA_TYPE_ROUTER: @@ -1046,18 +1046,16 @@ linked(struct vertex *w, struct vertex *v) rtr_link = get_rtr_link(w, i); switch (v->type) { case LSA_TYPE_ROUTER: -#if 0 if (rtr_link->type == LINK_TYPE_POINTTOPOINT && - rtr_link->id == htonl(v->ls_id)) + rtr_link->nbr_rtr_id == htonl(v->adv_rtr)) return (1); break; -#endif case LSA_TYPE_NETWORK: -#if 0 - if (rtr_link->id == htonl(v->ls_id)) + if (rtr_link->type == LINK_TYPE_TRANSIT_NET && + rtr_link->nbr_rtr_id == htonl(v->adv_rtr) && + rtr_link->nbr_iface_id == htonl(v->ls_id)) return (1); break; -#endif default: fatalx("linked: invalid type"); } @@ -1068,7 +1066,7 @@ linked(struct vertex *w, struct vertex *v) net_link = get_net_link(w, i); switch (v->type) { case LSA_TYPE_ROUTER: - if (net_link->att_rtr == htonl(v->ls_id)) + if (net_link->att_rtr == htonl(v->adv_rtr)) return (1); break; default: |