]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Destroying of neighbor moved from 'hello' to 'neighbor' and
authorOndrej Filip <feela@network.cz>
Wed, 10 May 2000 12:37:43 +0000 (12:37 +0000)
committerOndrej Filip <feela@network.cz>
Wed, 10 May 2000 12:37:43 +0000 (12:37 +0000)
improved.

proto/ospf/hello.c
proto/ospf/hello.h
proto/ospf/neighbor.c
proto/ospf/neighbor.h

index b6e34e286f6270def20daa93f4b3e0e062b976d7..eb506f4be597a32e11e1f0b64afc18ca744268a6 100644 (file)
@@ -238,23 +238,3 @@ wait_timer_hook(timer *timer)
   ospf_int_sm(ifa, ISM_WAITF);
 }
 
-/* Neighbor is inactive for a long time. Remove it. */
-void
-neighbor_timer_hook(timer *timer)
-{
-  struct ospf_neighbor *n;
-  struct ospf_iface *ifa;
-  struct proto *p;
-
-  n=(struct ospf_neighbor *)timer->data;
-  ifa=n->ifa;
-  p=(struct proto *)(ifa->proto);
-  debug("%s: Inactivity timer fired on interface %s for neighbor %I.\n",
-    p->name, ifa->iface->name, n->rid);
-  tm_stop(n->inactim);
-  rfree(n->inactim);
-  rem_node(NODE n);
-  mb_free(n);
-  debug("%s: Deleting neigbor.\n", p->name);
-  /* FIXME: Go on */
-}
index f40ea0188b4361ff44cf6f6c84f90eb3d56fae97..4369b60728a9c39760591cdcd009fca4b973f22f 100644 (file)
@@ -18,6 +18,5 @@ void ospf_hello_rx(struct ospf_hello_packet *ps, struct proto *p,
   struct ospf_iface *ifa, int size, ip_addr faddr);
 void hello_timer_hook(timer *timer);
 void wait_timer_hook(timer *timer);
-void neighbor_timer_hook(timer *timer);
 
 #endif /* _BIRD_OSPF_HELLO_H_ */
index c959ab873d92fe16d3d850aa4d20f4679ae63aca..78bba61892c2aedc04e14645738393ff1a487262 100644 (file)
@@ -427,4 +427,51 @@ ospf_find_area(struct proto_ospf *po, u32 aid)
   return NULL;
 }
 
+/* Neighbor is inactive for a long time. Remove it. */
+void
+neighbor_timer_hook(timer *timer)
+{
+  struct ospf_neighbor *n;
+  struct ospf_iface *ifa;
+  struct proto *p;
+
+  n=(struct ospf_neighbor *)timer->data;
+  ifa=n->ifa;
+  p=(struct proto *)(ifa->proto);
+  debug("%s: Inactivity timer fired on interface %s for neighbor %I.\n",
+    p->name, ifa->iface->name, n->rid);
+  neigh_chstate(n, NEIGHBOR_DOWN);
+  tm_stop(n->inactim);
+  rfree(n->inactim);
+  if(n->rxmt_timer!=NULL)
+  {
+    tm_stop(n->rxmt_timer);
+    rfree(n->rxmt_timer);
+  }
+  if(n->lsrr_timer!=NULL)
+  {
+    tm_stop(n->lsrr_timer);
+    rfree(n->lsrr_timer);
+  }
+  if(n->ackd_timer!=NULL)
+  {
+    tm_stop(n->ackd_timer);
+    rfree(n->ackd_timer);
+  }
+  if(n->ldbdes!=NULL)
+  {
+    mb_free(n->ldbdes);
+  }
+  if(n->lsrqh!=NULL)
+  {
+    ospf_top_free(n->lsrqh);
+  }
+  if(n->lsrth!=NULL)
+  {
+    ospf_top_free(n->lsrth);
+  }
+  rem_node(NODE n);
+  mb_free(n);
+  debug("%s: Deleting neigbor.\n", p->name);
+}                                                                               
 
index 501b9654468c7d5eb537c8eced25ff5abecde5c7..5deb37a63e050a2d2bee636dff2331e254266feb 100644 (file)
@@ -20,5 +20,6 @@ void bdr_election(struct ospf_iface *ifa, struct proto *p);
 struct ospf_neighbor *find_neigh(struct ospf_iface *ifa, u32 rid);
 struct ospf_neighbor *find_neigh_noifa(struct proto_ospf *po, u32 rid);
 struct ospf_area *ospf_find_area(struct proto_ospf *po, u32 aid);
+void neighbor_timer_hook(timer *timer);
 
 #endif /* _BIRD_OSPF_NEIGHBOR_H_ */