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.c32
1 files changed, 13 insertions, 19 deletions
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index 7ddffbcdbd..cfcffcdb3d 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -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();
@@ -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;
}