Merge pull request #13612 from chiragshah6/fdev1

ospfd: fix interface param type update
This commit is contained in:
Russ White 2023-06-13 09:55:07 -04:00 committed by GitHub
commit 609491fe0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1346,18 +1346,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);
}