summaryrefslogtreecommitdiff
path: root/usr.sbin/ospf6d/neighbor.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2007-12-13 08:54:06 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2007-12-13 08:54:06 +0000
commitfafcca9d0e42d9a6e03ef570d77dca5315942a58 (patch)
tree596faa7402ccb9033dc9f620dd603a29a2a3d367 /usr.sbin/ospf6d/neighbor.c
parent5d7de864ea3c020d02a9416491971c124d8daf39 (diff)
Monster commit of stuff I did mostly last month. What it does:
* removes kif and uses iface for everything interface related. This removes unneeded data redundancy which makes the code more complex. * adds the link local prefix to struct iface and attaches a list with the other prefixes to the struct iface. This is needed to generate the link LSA. * disconnects struct iface from struct area (the backpointer is gone) this will make the reload code a bit easier. norby@ agrees with the direction we're heading with this
Diffstat (limited to 'usr.sbin/ospf6d/neighbor.c')
-rw-r--r--usr.sbin/ospf6d/neighbor.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/usr.sbin/ospf6d/neighbor.c b/usr.sbin/ospf6d/neighbor.c
index 8352803c0ef..9e5f77199aa 100644
--- a/usr.sbin/ospf6d/neighbor.c
+++ b/usr.sbin/ospf6d/neighbor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: neighbor.c,v 1.4 2007/11/27 11:29:34 claudio Exp $ */
+/* $OpenBSD: neighbor.c,v 1.5 2007/12/13 08:54:05 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -200,12 +200,14 @@ nbr_fsm(struct nbr *nbr, enum nbr_event event)
nbr->peerid, 0, &new_state, sizeof(new_state));
if (old_state & NBR_STA_FULL || nbr->state & NBR_STA_FULL) {
+ extern struct ospfd_conf *oeconf; /* XXX */
/*
* neighbor changed from/to FULL
* originate new rtr and net LSA
*/
- area_track(nbr->iface->area, nbr->state);
- orig_rtr_lsa(nbr->iface->area);
+ area_track(area_find(oeconf, nbr->iface->area_id),
+ nbr->state);
+ orig_rtr_lsa(nbr->iface);
if (nbr->iface->state & IF_STA_DR)
orig_net_lsa(nbr->iface);
@@ -225,7 +227,7 @@ nbr_fsm(struct nbr *nbr, enum nbr_event event)
nbr_state_name(nbr->state));
if (nbr->iface->type == IF_TYPE_VIRTUALLINK) {
- orig_rtr_lsa(nbr->iface->area);
+ orig_rtr_lsa(nbr->iface);
}
}
@@ -313,7 +315,7 @@ nbr_new(u_int32_t nbr_id, struct iface *iface, int self)
bzero(&rn, sizeof(rn));
rn.id.s_addr = nbr->id.s_addr;
- rn.area_id.s_addr = nbr->iface->area->id.s_addr;
+ rn.area_id.s_addr = nbr->iface->area_id.s_addr;
rn.ifindex = nbr->iface->ifindex;
rn.state = nbr->state;
rn.self = self;
@@ -644,7 +646,7 @@ nbr_to_ctl(struct nbr *nbr)
memcpy(&nctl.addr, &nbr->addr, sizeof(nctl.addr));
memcpy(&nctl.dr, &nbr->dr, sizeof(nctl.dr));
memcpy(&nctl.bdr, &nbr->bdr, sizeof(nctl.bdr));
- memcpy(&nctl.area, &nbr->iface->area->id, sizeof(nctl.area));
+ memcpy(&nctl.area, &nbr->iface->area_id, sizeof(nctl.area));
/* this list is 99% of the time empty so that's OK for now */
nctl.db_sum_lst_cnt = 0;