Revision 60e04f04

View differences:

proto/ospf/ospf.h
83 83
  struct fib_node fn;
84 84
  int hidden;
85 85
  int active;
86
  u32 metric;
86 87
};
87 88

  
88 89
struct ospf_area_config
proto/ospf/rt.c
119 119
      old->efn = ipath;
120 120
    }
121 121
    if ((new->type == RTS_OSPF) && (anet = (struct area_net *)fib_route(&oa->net_fib, prefix, pxlen)))
122
    {
122 123
       anet->active = 1;
124
       if (new->metric1 < anet->metric) anet->metric = new->metric1;
125
    }
123 126
  }
124 127
  else
125 128
  {
......
585 588
    {
586 589
      anet = (struct area_net *) nftmp;
587 590
      anet->active = 0;
591
      anet->metric = LSINFINITY;
588 592
    }
589 593
    FIB_WALK_END;
590 594
    ospf_rt_spfa(oa);
......
1046 1050
	if ((oa == po->backbone) && oaa->trcap) fl = 1;
1047 1051

  
1048 1052
        if(fl) flush_sum_lsa(oaa, &anet->fn, ORT_NET);
1049
        else originate_sum_lsa(oaa, &anet->fn, ORT_NET, 1);
1053
        else originate_sum_lsa(oaa, &anet->fn, ORT_NET, anet->metric);
1050 1054
      }
1051 1055
    }
1052 1056
    FIB_WALK_END;
proto/ospf/rt.h
21 21
#define ORTA_ASBR 1
22 22
#define ORTA_ABR 2
23 23
  struct ospf_area *oa;
24
  int metric1;
25
  int metric2;
24
  u32 metric1;
25
  u32 metric2;
26 26
  ip_addr nh;			/* Next hop */
27 27
  struct ospf_iface *ifa;	/* Outgoing interface */
28 28
  struct top_hash_entry *ar;	/* Advertising router */

Also available in: Unified diff