summaryrefslogtreecommitdiffstats
path: root/ospfd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-06-29 16:10:15 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-06-29 16:10:15 +0200
commitb440fe5c82f73a4f34ebc59ac07e95f56e1193e0 (patch)
tree8fc9b00b7b2d4057bd70e7d1fa7085a3036733bc /ospfd
parentMerge pull request #764 from Jafaral/ospfintaddr (diff)
parentMerge pull request #756 from opensourcerouting/isis-redist-fixes (diff)
downloadfrr-b440fe5c82f73a4f34ebc59ac07e95f56e1193e0.tar.xz
frr-b440fe5c82f73a4f34ebc59ac07e95f56e1193e0.zip
Merge remote-tracking branch 'origin/stable/3.0'
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ospf_interface.c8
-rw-r--r--ospfd/ospf_vty.c5
-rw-r--r--ospfd/ospf_zebra.c12
3 files changed, 13 insertions, 12 deletions
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index 1f3cc1013..c09092e81 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -58,7 +58,13 @@ 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;
+ /* ifp speed and bw can be 0 in some platforms, use ospf default bw
+ if bw is configured under interface it would be used.
+ */
+ if (!oi->ifp->bandwidth && oi->ifp->speed)
+ bw = oi->ifp->speed;
+ else
+ bw = oi->ifp->bandwidth ? oi->ifp->bandwidth : OSPF_DEFAULT_BANDWIDTH;
refbw = oi->ospf->ref_bandwidth;
/* A specifed ip ospf cost overrides a calculated one. */
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index a2e1d601f..1cd61caaf 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -3251,6 +3251,7 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface
int is_up;
struct ospf_neighbor *nbr;
struct route_node *rn;
+ uint32_t bandwidth = ifp->bandwidth ? ifp->bandwidth : ifp->speed;
/* Is interface up? */
if (use_json)
@@ -3263,7 +3264,7 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface
json_object_int_add(json_interface_sub, "ifIndex", ifp->ifindex);
json_object_int_add(json_interface_sub, "mtuBytes", ifp->mtu);
- json_object_int_add(json_interface_sub, "bandwidthMbit", ifp->bandwidth);
+ json_object_int_add(json_interface_sub, "bandwidthMbit", bandwidth);
json_object_string_add(json_interface_sub, "ifFlags", if_flag_dump(ifp->flags));
}
else
@@ -3271,7 +3272,7 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface
vty_out (vty, "%s is %s%s", ifp->name,
((is_up = if_is_operative(ifp)) ? "up" : "down"), VTY_NEWLINE);
vty_out (vty, " ifindex %u, MTU %u bytes, BW %u Mbit %s%s",
- ifp->ifindex, ifp->mtu, ifp->bandwidth, if_flag_dump(ifp->flags),
+ ifp->ifindex, ifp->mtu, bandwidth, if_flag_dump(ifp->flags),
VTY_NEWLINE);
}
diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c
index 4df49db9b..6bf8996e0 100644
--- a/ospfd/ospf_zebra.c
+++ b/ospfd/ospf_zebra.c
@@ -187,16 +187,10 @@ ospf_interface_state_up (int command, struct zclient *zclient,
zebra_interface_if_set_value (zclient->ibuf, ifp);
if (IS_DEBUG_OSPF (zebra, ZEBRA_INTERFACE))
- zlog_debug ("Zebra: Interface[%s] state update.", ifp->name);
+ zlog_debug ("Zebra: Interface[%s] state update speed %u -> %u, bw %d -> %d",
+ ifp->name, if_tmp.speed, ifp->speed, if_tmp.bandwidth, ifp->bandwidth);
- if (if_tmp.bandwidth != ifp->bandwidth)
- {
- if (IS_DEBUG_OSPF (zebra, ZEBRA_INTERFACE))
- zlog_debug ("Zebra: Interface[%s] bandwidth change %d -> %d.",
- ifp->name, if_tmp.bandwidth, ifp->bandwidth);
-
- ospf_if_recalculate_output_cost (ifp);
- }
+ ospf_if_recalculate_output_cost (ifp);
if (if_tmp.mtu != ifp->mtu)
{