From 85195f1a53eb350cd32ecba69c208dbece6fb776 Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Sun, 30 Apr 2000 22:14:31 +0000 Subject: Many small changes and bug fixes. Routing table calculation works. I'm waiting for rt lookup to add stub networks. --- proto/ospf/neighbor.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'proto/ospf/neighbor.c') diff --git a/proto/ospf/neighbor.c b/proto/ospf/neighbor.c index 4a450c1..4a44b6b 100644 --- a/proto/ospf/neighbor.c +++ b/proto/ospf/neighbor.c @@ -178,9 +178,8 @@ void ospf_neigh_sm(struct ospf_neighbor *n, int event) /* Interface state machine */ { - struct proto *p; - - p=(struct proto *)(n->ifa->proto); + struct proto *p=(struct proto *)(n->ifa->proto); + struct proto_ospf *po=n->ifa->proto; DBG("%s: Neighbor state machine for neighbor %I, event \"%s\".\n", p->name, n->rid, ospf_inm[event]); @@ -203,7 +202,7 @@ ospf_neigh_sm(struct ospf_neighbor *n, int event) } break; case INM_2WAYREC: - if(n->state==NEIGHBOR_INIT) + if(n->stateifa, ISM_NEICH); } break; case INM_NEGDONE: @@ -236,6 +236,7 @@ ospf_neigh_sm(struct ospf_neighbor *n, int event) break; case INM_LOADDONE: neigh_chstate(n,NEIGHBOR_FULL); + originate_rt_lsa(n->ifa->oa,po); break; case INM_ADJOK: switch(n->state) @@ -271,11 +272,13 @@ ospf_neigh_sm(struct ospf_neighbor *n, int event) case INM_LLDOWN: case INM_INACTTIM: neigh_chstate(n,NEIGHBOR_DOWN); + ospf_int_sm(n->ifa, ISM_NEICH); break; case INM_1WAYREC: if(n->state>=NEIGHBOR_2WAY) { neigh_chstate(n,NEIGHBOR_DOWN); + ospf_int_sm(n->ifa, ISM_NEICH); } break; default: @@ -287,7 +290,7 @@ ospf_neigh_sm(struct ospf_neighbor *n, int event) void bdr_election(struct ospf_iface *ifa, struct proto *p) { - struct ospf_neighbor *neigh,*ndr,*nbdr,me; + struct ospf_neighbor *neigh,*ndr,*nbdr,me,*tmp; u32 myid, ndrid, nbdrid; int doadj; @@ -335,7 +338,11 @@ bdr_election(struct ospf_iface *ifa, struct proto *p) doadj=0; if((ifa->drid!=ndrid) || (ifa->bdrid!=nbdrid)) doadj=1; ifa->drid=ndrid; + if((tmp=find_neigh(ifa,ndrid))==NULL) die("Error i BDR election.\n"); + ifa->drip=tmp->ip; ifa->bdrid=nbdrid; + if((tmp=find_neigh(ifa,nbdrid))==NULL) die("Error i BDR election.\n"); + ifa->bdrip=tmp->ip; DBG("%s: DR=%I, BDR=%I\n",p->name, ifa->drid, ifa->bdrid); -- cgit v1.2.3