Revision 600998fc sysdep/unix/krt.c

View differences:

sysdep/unix/krt.c
412 412

  
413 413
  FIB_ITERATE_INIT(&fit, fib);
414 414
again:
415
  FIB_ITERATE_START(fib, &fit, f)
415
  FIB_ITERATE_START(fib, &fit, net, n)
416 416
    {
417
      net *n = (net *) f;
418 417
      rte *e, **ee, *best, **pbest, *old_best;
419 418

  
420 419
      old_best = n->routes;
......
445 444
	      krt_learn_announce_delete(p, n);
446 445
	      n->n.flags &= ~KRF_INSTALLED;
447 446
	    }
448
	  FIB_ITERATE_PUT(&fit, f);
449
	  fib_delete(fib, f);
447
	  FIB_ITERATE_PUT(&fit);
448
	  fib_delete(fib, n);
450 449
	  goto again;
451 450
	}
452 451
      *pbest = best->next;
......
461 460
      else
462 461
	DBG("%I/%d: uptodate (metric=%d)\n", n->n.prefix, n->n.pxlen, best->u.krt.metric);
463 462
    }
464
  FIB_ITERATE_END(f);
463
  FIB_ITERATE_END;
465 464

  
466 465
  p->reload = 0;
467 466
}
......
579 578
  struct rtable *t = p->p.table;
580 579

  
581 580
  KRT_TRACE(p, D_EVENTS, "Flushing kernel routes");
582
  FIB_WALK(&t->fib, f)
581
  FIB_WALK(&t->fib, net, n)
583 582
    {
584
      net *n = (net *) f;
585 583
      rte *e = n->routes;
586 584
      if (rte_is_valid(e) && (n->n.flags & KRF_INSTALLED))
587 585
	{
......
751 749
  struct rtable *t = p->p.table;
752 750

  
753 751
  KRT_TRACE(p, D_EVENTS, "Pruning table %s", t->name);
754
  FIB_WALK(&t->fib, f)
752
  FIB_WALK(&t->fib, net, n)
755 753
    {
756
      net *n = (net *) f;
757
      int verdict = f->flags & KRF_VERDICT_MASK;
754
      int verdict = n->n.flags & KRF_VERDICT_MASK;
758 755
      rte *new, *old, *rt_free = NULL;
759 756
      ea_list *tmpa = NULL;
760 757

  
......
783 780
      switch (verdict)
784 781
	{
785 782
	case KRF_CREATE:
786
	  if (new && (f->flags & KRF_INSTALLED))
783
	  if (new && (n->n.flags & KRF_INSTALLED))
787 784
	    {
788 785
	      krt_trace_in(p, new, "reinstalling");
789 786
	      krt_replace_rte(p, n, new, NULL, tmpa);
......
810 807
      if (rt_free)
811 808
	rte_free(rt_free);
812 809
      lp_flush(krt_filter_lp);
813
      f->flags &= ~KRF_VERDICT_MASK;
810
      n->n.flags &= ~KRF_VERDICT_MASK;
814 811
    }
815 812
  FIB_WALK_END;
816 813

  

Also available in: Unified diff