0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 09:41:54 +00:00

Premature age LSA if you're NOT dr.

This commit is contained in:
Ondrej Filip 2000-06-05 05:06:22 +00:00
parent 88048fb3c9
commit dc2548d2cc

View File

@ -19,13 +19,15 @@ char *ospf_it[]={ "broadcast", "nbma", "point-to-point", "virtual link" };
void void
iface_chstate(struct ospf_iface *ifa, u8 state) iface_chstate(struct ospf_iface *ifa, u8 state)
{ {
struct proto *p; struct proto_ospf *po=ifa->proto;
struct proto *p=&po->proto;
u8 oldstate;
if(ifa->state!=state) if(ifa->state!=state)
{ {
p=(struct proto *)(ifa->proto);
debug("%s: Changing state of iface: %s from \"%s\" into \"%s\".\n", debug("%s: Changing state of iface: %s from \"%s\" into \"%s\".\n",
p->name, ifa->iface->name, ospf_is[ifa->state], ospf_is[state]); p->name, ifa->iface->name, ospf_is[ifa->state], ospf_is[state]);
oldstate=ifa->state;
ifa->state=state; ifa->state=state;
if(ifa->iface->flags & IF_MULTICAST) if(ifa->iface->flags & IF_MULTICAST)
{ {
@ -62,6 +64,12 @@ iface_chstate(struct ospf_iface *ifa, u8 state)
ifa->dr_sk=NULL; ifa->dr_sk=NULL;
} }
} }
if(oldstate==OSPF_IS_DR)
{
net_flush_lsa(ifa->nlsa,po,ifa->oa);
if(can_flush_lsa(ifa->oa)) flush_lsa(ifa->nlsa,ifa->oa);
ifa->nlsa=NULL;
}
} }
} }
} }