summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ospfd/ospf_interface.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index f71d222e98..b49f89b1a1 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -1344,18 +1344,28 @@ static int ospf_ifp_create(struct interface *ifp)
if (IS_DEBUG_OSPF(zebra, ZEBRA_INTERFACE))
zlog_debug(
- "Zebra: interface add %s vrf %s[%u] index %d flags %llx metric %d mtu %d speed %u",
+ "Zebra: interface add %s vrf %s[%u] index %d flags %llx metric %d mtu %d speed %u status 0x%x",
ifp->name, ifp->vrf->name, ifp->vrf->vrf_id,
ifp->ifindex, (unsigned long long)ifp->flags,
- ifp->metric, ifp->mtu, ifp->speed);
+ ifp->metric, ifp->mtu, ifp->speed, ifp->status);
assert(ifp->info);
oii = ifp->info;
oii->curr_mtu = ifp->mtu;
- if (IF_DEF_PARAMS(ifp)
- && !OSPF_IF_PARAM_CONFIGURED(IF_DEF_PARAMS(ifp), type)) {
+ /* Change ospf type param based on following
+ * condition:
+ * ospf type params is not set (first creation),
+ * OR ospf param type is changed based on
+ * link event, currently only handle for
+ * loopback interface type, for other ospf interface,
+ * type can be set from user config which needs to be
+ * preserved.
+ */
+ if (IF_DEF_PARAMS(ifp) &&
+ (!OSPF_IF_PARAM_CONFIGURED(IF_DEF_PARAMS(ifp), type) ||
+ if_is_loopback(ifp))) {
SET_IF_PARAM(IF_DEF_PARAMS(ifp), type);
IF_DEF_PARAMS(ifp)->type = ospf_default_iftype(ifp);
}