diff options
| author | Jafar Al-Gharaibeh <Jafaral@users.noreply.github.com> | 2017-09-19 10:58:28 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-19 10:58:28 -0500 |
| commit | 5287239750e791bdd4df7356984e21f5d65b39df (patch) | |
| tree | 630f6f4acf98f6b4c210b796f3f9c1e4f2e5fc75 /ospf6d/ospf6_interface.c | |
| parent | 3fabacd286766120959bd11f06668f328406b483 (diff) | |
| parent | 27ae9bcd9d7cc3826e010c80d75aea52b00521d0 (diff) | |
Merge pull request #1197 from chiragshah6/ospfv3_dev
ospf6d: OSPFv3 interface bandwidth handling
Diffstat (limited to 'ospf6d/ospf6_interface.c')
| -rw-r--r-- | ospf6d/ospf6_interface.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index 8cfed81a81..8e01cb4379 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -117,8 +117,17 @@ static u_int32_t ospf6_interface_get_cost(struct ospf6_interface *oi) u_int32_t cost; u_int32_t bw, refbw; - bw = oi->interface->bandwidth ? oi->interface->bandwidth - : OSPF6_INTERFACE_BANDWIDTH; + /* interface speed and bw can be 0 in some platforms, + * use ospf default bw. If bw is configured then it would + * be used. + */ + if (!oi->interface->bandwidth && oi->interface->speed) { + bw = oi->interface->speed; + } else { + bw = oi->interface->bandwidth ? oi->interface->bandwidth + : OSPF6_INTERFACE_BANDWIDTH; + } + refbw = ospf6 ? ospf6->ref_bandwidth : OSPF6_REFERENCE_BANDWIDTH; /* A specifed ip ospf cost overrides a calculated one. */ |
