diff options
| author | Donald Sharp <donaldsharp72@gmail.com> | 2023-06-13 15:06:11 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-13 15:06:11 -0400 |
| commit | 2f61f92105288a9ddb349f27a3edf9d6594dd03c (patch) | |
| tree | 778ddc2db45ada72ab6123671e3b110100935776 | |
| parent | 7a6f6fca206f6bfd469bd3004e00f4cfa7c24b70 (diff) | |
| parent | 9da5c285de38fe11ebf96f01df0d4fa8079e8ad6 (diff) | |
Merge pull request #13785 from FRRouting/mergify/bp/stable/8.4/pr-13612
ospfd: fix interface param type update (backport #13612)
| -rw-r--r-- | ospfd/ospf_interface.c | 18 |
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); } |
