summaryrefslogtreecommitdiff
path: root/usr.sbin/ospf6d/rde.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2007-11-27 11:29:35 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2007-11-27 11:29:35 +0000
commit46b3cdc6bb6bf33b0c4e39472b98f8cb224ebbdc (patch)
tree0aed944affe4303faea8f6f36b2f625a1d5d9f50 /usr.sbin/ospf6d/rde.c
parent8159ded805fca63dccb4cfb60ebd609f9039d19d (diff)
Monster diff to bring us a bit on track again.
a) implement all (or at least most) lsa_check() cases. b) classify the LSA scope correctly and add a per interface lsa_tree for the link local stuff. c) implement a function to parse a prefix. There is still a lot missing currently link local LSA are added to the interface tree but nothing can access them (lsa_find() and a few friends need some changes). OK norby@
Diffstat (limited to 'usr.sbin/ospf6d/rde.c')
-rw-r--r--usr.sbin/ospf6d/rde.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.sbin/ospf6d/rde.c b/usr.sbin/ospf6d/rde.c
index 0a31b46022d..88f63289cb1 100644
--- a/usr.sbin/ospf6d/rde.c
+++ b/usr.sbin/ospf6d/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.7 2007/10/17 07:16:02 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.8 2007/11/27 11:29:34 claudio Exp $ */
/*
* Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
@@ -675,6 +675,7 @@ rde_dispatch_parent(int fd, short event, void *bula)
LIST_INIT(&niface->nbr_list);
TAILQ_INIT(&niface->ls_ack_list);
+ RB_INIT(&niface->lsa_tree);
niface->area = narea;
LIST_INSERT_HEAD(&narea->iface_list, niface, entry);
@@ -865,18 +866,27 @@ rde_nbr_new(u_int32_t peerid, struct rde_nbr *new)
struct rde_nbr_head *head;
struct rde_nbr *nbr;
struct area *area;
+ struct iface *iface;
if (rde_nbr_find(peerid))
return (NULL);
if ((area = area_find(rdeconf, new->area_id)) == NULL)
fatalx("rde_nbr_new: unknown area");
+ LIST_FOREACH(iface, &area->iface_list, entry) {
+ if (iface->ifindex == new->ifindex)
+ break;
+ }
+ if (iface == NULL)
+ fatalx("rde_nbr_new: unknown interface");
+
if ((nbr = calloc(1, sizeof(*nbr))) == NULL)
fatal("rde_nbr_new");
memcpy(nbr, new, sizeof(*nbr));
nbr->peerid = peerid;
nbr->area = area;
+ nbr->iface = iface;
TAILQ_INIT(&nbr->req_list);