summaryrefslogtreecommitdiff
path: root/ospfd/ospf_interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospfd/ospf_interface.c')
-rw-r--r--ospfd/ospf_interface.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index 5459e3b87c..cfcffcdb3d 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -273,7 +273,7 @@ struct ospf_interface *ospf_if_new(struct ospf *ospf, struct interface *ifp,
if (IS_DEBUG_OSPF_EVENT)
zlog_debug("%s: ospf interface %s vrf %s id %u created",
__PRETTY_FUNCTION__, ifp->name,
- ospf_vrf_id_to_name(ospf->vrf_id), ospf->vrf_id);
+ ospf_get_name(ospf), ospf->vrf_id);
return oi;
}
@@ -636,9 +636,13 @@ void ospf_if_update_params(struct interface *ifp, struct in_addr addr)
int ospf_if_new_hook(struct interface *ifp)
{
int rc = 0;
+ struct ospf_if_info *oii;
ifp->info = XCALLOC(MTYPE_OSPF_IF_INFO, sizeof(struct ospf_if_info));
+ oii = ifp->info;
+ oii->curr_mtu = ifp->mtu;
+
IF_OIFS(ifp) = route_table_init();
IF_OIFS_PARAMS(ifp) = route_table_init();
@@ -832,7 +836,7 @@ struct ospf_interface *ospf_vl_new(struct ospf *ospf,
struct prefix_ipv4 *p;
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug("ospf_vl_new(): Start");
+ zlog_debug("ospf_vl_new()(%s): Start", ospf_get_name(ospf));
if (vlink_count == OSPF_VL_MAX_COUNT) {
if (IS_DEBUG_OSPF_EVENT)
zlog_debug(
@@ -1261,31 +1265,21 @@ static int ospf_ifp_up(struct interface *ifp)
{
struct ospf_interface *oi;
struct route_node *rn;
+ struct ospf_if_info *oii = ifp->info;
- /* Interface is already up. */
- if (if_is_operative(ifp)) {
- /* Temporarily keep ifp values. */
- struct interface if_tmp;
- memcpy(&if_tmp, ifp, sizeof(struct interface));
+ ospf_if_recalculate_output_cost(ifp);
+ if (oii && oii->curr_mtu != ifp->mtu) {
if (IS_DEBUG_OSPF(zebra, ZEBRA_INTERFACE))
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);
+ "Zebra: Interface[%s] MTU change %u -> %u.",
+ ifp->name, oii->curr_mtu, ifp->mtu);
- ospf_if_recalculate_output_cost(ifp);
+ oii->curr_mtu = ifp->mtu;
+ /* Must reset the interface (simulate down/up) when MTU
+ * changes. */
+ ospf_if_reset(ifp);
- if (if_tmp.mtu != ifp->mtu) {
- if (IS_DEBUG_OSPF(zebra, ZEBRA_INTERFACE))
- zlog_debug(
- "Zebra: Interface[%s] MTU change %u -> %u.",
- ifp->name, if_tmp.mtu, ifp->mtu);
-
- /* Must reset the interface (simulate down/up) when MTU
- * changes. */
- ospf_if_reset(ifp);
- }
return 0;
}