Revision 035f6acb proto/ospf/neighbor.c

View differences:

proto/ospf/neighbor.c
261 261
      if(n->state==NEIGHBOR_EXSTART)
262 262
      {
263 263
        neigh_chstate(n,NEIGHBOR_EXCHANGE);
264
        while(!EMPTY_LIST(n->ackl))
265
        {
266
          struct lsah_n *no;
267
          no=(struct lsah_n *)HEAD(n->ackl);
268
          rem_node(NODE no);
269
          mb_free(no);
270
        }
264 271
        s_init_list(&(n->lsrql));
265
	n->lsrqh=ospf_top_new(n->ifa->proto);
272
	if(n->lsrqh) ospf_top_free(n->lsrqh);
273
	n->lsrqh=ospf_top_new(n->pool, n->ifa->proto);
266 274
        s_init_list(&(n->lsrtl));
267
	n->lsrth=ospf_top_new(n->ifa->proto);
275
	if(n->lsrth) ospf_top_free(n->lsrth);
276
	n->lsrth=ospf_top_new(n->pool, n->ifa->proto);
268 277
	s_init(&(n->dbsi), &(n->ifa->oa->lsal));
269 278
	s_init(&(n->lsrqi), &(n->lsrql));
270 279
	s_init(&(n->lsrti), &(n->lsrtl));
......
490 499
  ifa=n->ifa;
491 500
  p=(struct proto *)(ifa->proto);
492 501
  neigh_chstate(n, NEIGHBOR_DOWN);
493
  tm_stop(n->inactim);
494
  rfree(n->inactim);
495
  if(n->rxmt_timer!=NULL)
496
  {
497
    tm_stop(n->rxmt_timer);
498
    rfree(n->rxmt_timer);
499
  }
500
  if(n->lsrr_timer!=NULL)
501
  {
502
    tm_stop(n->lsrr_timer);
503
    rfree(n->lsrr_timer);
504
  }
505
  if(n->ackd_timer!=NULL)
506
  {
507
    tm_stop(n->ackd_timer);
508
    rfree(n->ackd_timer);
509
  }
510
  if(n->ldbdes!=NULL)
511
  {
512
    mb_free(n->ldbdes);
513
  }
514
  if(n->lsrqh!=NULL)
515
  {
516
    ospf_top_free(n->lsrqh);
517
  }
518
  if(n->lsrth!=NULL)
519
  {
520
    ospf_top_free(n->lsrth);
521
  }
522 502
  rem_node(NODE n);
523
  mb_free(n);
503
  rfree(n->pool);
524 504
  OSPF_TRACE(D_EVENTS, "Deleting neigbor.");
525 505
}
526 506

  

Also available in: Unified diff