Easier cleanup of an interface.

This commit is contained in:
Ondrej Filip 2004-06-01 13:44:53 +00:00
parent c9f6cf8a05
commit e8bf6c0766

View file

@ -67,13 +67,10 @@ iface_chstate(struct ospf_iface *ifa, u8 state)
} }
} }
else else
{
if(ifa->dr_sk!=NULL)
{ {
rfree(ifa->dr_sk); rfree(ifa->dr_sk);
ifa->dr_sk=NULL; ifa->dr_sk=NULL;
} }
}
if((oldstate==OSPF_IS_DR)&&(ifa->nlsa!=NULL)) if((oldstate==OSPF_IS_DR)&&(ifa->nlsa!=NULL))
{ {
ifa->nlsa->lsa.age=LSA_MAXAGE; ifa->nlsa->lsa.age=LSA_MAXAGE;
@ -101,30 +98,15 @@ downint(struct ospf_iface *ifa)
ospf_neigh_remove(n); ospf_neigh_remove(n);
} }
rem_node(NODE ifa); rem_node(NODE ifa);
if(ifa->hello_sk!=NULL)
rfree(ifa->hello_sk); rfree(ifa->hello_sk);
if(ifa->dr_sk!=NULL)
rfree(ifa->dr_sk); rfree(ifa->dr_sk);
if(ifa->ip_sk!=NULL)
rfree(ifa->ip_sk); rfree(ifa->ip_sk);
if(ifa->wait_timer!=NULL)
{
tm_stop(ifa->wait_timer);
rfree(ifa->wait_timer); rfree(ifa->wait_timer);
}
if(ifa->hello_timer!=NULL)
{
tm_stop(ifa->hello_timer);
rfree(ifa->hello_timer); rfree(ifa->hello_timer);
}
if(ifa->poll_timer!=NULL)
{
tm_stop(ifa->poll_timer);
rfree(ifa->poll_timer); rfree(ifa->poll_timer);
}
rfree(ifa->lock); rfree(ifa->lock);
mb_free(ifa); mb_free(ifa);
} }