summaryrefslogtreecommitdiff
path: root/ospfd/ospf_interface.c
diff options
context:
space:
mode:
authorChirag Shah <chirag@cumulusnetworks.com>2017-06-12 09:53:21 -0700
committerChirag Shah <chirag@cumulusnetworks.com>2017-06-12 09:55:56 -0700
commit05b15adcc25c530c20e90ef03412f0ca1c155c03 (patch)
treee27b3fdef24b3bd97f8bd715b7b6d39aba7453c0 /ospfd/ospf_interface.c
parent5356483183040219320f255b6c8b62e5fc0a0665 (diff)
ospfd: ospf bandwidth handling
if bandwidth is not set from Zebra use speed as bandwidth for ospf route. Testing Done: Verfied over bond which has aggregated speed of all member interfaces, cost is reflected in ospf route and ip route. Manually changed interface bandwidth which replaces speed as bw, instead uses cli entered value as bw, verifid output of ospf route and ip route. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Diffstat (limited to 'ospfd/ospf_interface.c')
-rw-r--r--ospfd/ospf_interface.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index 137df16a05..2c270c5ca2 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -59,7 +59,12 @@ ospf_if_get_output_cost (struct ospf_interface *oi)
u_int32_t cost;
u_int32_t bw, refbw;
- bw = oi->ifp->bandwidth ? oi->ifp->bandwidth : OSPF_DEFAULT_BANDWIDTH;
+ if (oi->ifp->bandwidth)
+ bw = oi->ifp->bandwidth;
+ if (!oi->ifp->bandwidth && oi->ifp->speed)
+ bw = oi->ifp->speed;
+ else
+ bw = OSPF_DEFAULT_BANDWIDTH;
refbw = oi->ospf->ref_bandwidth;
/* A specifed ip ospf cost overrides a calculated one. */