summaryrefslogtreecommitdiffstats
path: root/proto/ospf
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2000-05-10 13:48:21 +0200
committerOndrej Filip <feela@network.cz>2000-05-10 13:48:21 +0200
commit28950169e7ac82ceb9a6d72fe2789714b4073eb2 (patch)
tree6fd734ebe02455987827aacb74b06629624e6e2b /proto/ospf
parentd9f89e011498ec54006a026d9e0dd963db663ab0 (diff)
downloadbird-28950169e7ac82ceb9a6d72fe2789714b4073eb2.tar
bird-28950169e7ac82ceb9a6d72fe2789714b4073eb2.zip
Bug in (B)DR election fixed.
Diffstat (limited to 'proto/ospf')
-rw-r--r--proto/ospf/neighbor.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/proto/ospf/neighbor.c b/proto/ospf/neighbor.c
index 96449d1..c959ab8 100644
--- a/proto/ospf/neighbor.c
+++ b/proto/ospf/neighbor.c
@@ -349,11 +349,31 @@ 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;
+ if(ndrid==0)
+ {
+ ifa->drid=0;
+ ifa->drip=ipa_from_u32(0);
+ }
+ else
+ {
+ if((tmp=find_neigh(ifa,ndrid))==NULL)
+ die("Error in DR election.\n");
+ ifa->drid=ndrid;
+ ifa->drip=tmp->ip;
+ }
+
+ if(nbdrid==0)
+ {
+ ifa->bdrid=0;
+ ifa->bdrip=ipa_from_u32(0);
+ }
+ else
+ {
+ if((tmp=find_neigh(ifa,nbdrid))==NULL)
+ die("Error in BDR election.\n");
+ ifa->bdrid=nbdrid;
+ ifa->bdrip=tmp->ip;
+ }
DBG("%s: DR=%I, BDR=%I\n",p->name, ifa->drid, ifa->bdrid);