From dc2548d2ccc45722f0dcaa861dd3b45a397d2cac Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Mon, 5 Jun 2000 05:06:22 +0000 Subject: Premature age LSA if you're NOT dr. --- proto/ospf/iface.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'proto') diff --git a/proto/ospf/iface.c b/proto/ospf/iface.c index f7be7eb..f34d249 100644 --- a/proto/ospf/iface.c +++ b/proto/ospf/iface.c @@ -19,13 +19,15 @@ char *ospf_it[]={ "broadcast", "nbma", "point-to-point", "virtual link" }; void 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) { - p=(struct proto *)(ifa->proto); debug("%s: Changing state of iface: %s from \"%s\" into \"%s\".\n", p->name, ifa->iface->name, ospf_is[ifa->state], ospf_is[state]); + oldstate=ifa->state; ifa->state=state; if(ifa->iface->flags & IF_MULTICAST) { @@ -62,6 +64,12 @@ iface_chstate(struct ospf_iface *ifa, u8 state) 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; + } } } } -- cgit v1.2.3