mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-30 20:47:58 +00:00
ospfd: fix interface param type update
interface link update event needs
to be handle properly in ospf interface
cache.
Example:
When vrf (interface) is created its default type
would be set to BROADCAST because ifp->status
is not set to VRF.
Subsequent link event sets ifp->status to vrf,
ospf interface update need to compare current type
to new default type which would be VRF (OSPF_IFTYPE_LOOPBACK).
Since ospf type param was created in first add event,
ifp vrf link event didn't update ospf type param which
leads to treat vrf as non loopback interface.
Ticket:#3459451
Testing Done:
Running config suppose to bypass rendering default
network broadcast for loopback/vrf types.
Before fix:
vrf vrf1
vni 4001
exit-vrf
!
interface vrf1
ip ospf network broadcast
exit
After fix: (interface vrf1 is not displayed).
vrf vrf1
vni 4001
exit-vrf
Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit 0d005b2d5c
)
This commit is contained in:
parent
5dc6972e13
commit
4edc16b7a3
@ -1346,18 +1346,28 @@ static int ospf_ifp_create(struct interface *ifp)
|
|||||||
|
|
||||||
if (IS_DEBUG_OSPF(zebra, ZEBRA_INTERFACE))
|
if (IS_DEBUG_OSPF(zebra, ZEBRA_INTERFACE))
|
||||||
zlog_debug(
|
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->name, ifp->vrf->name, ifp->vrf->vrf_id,
|
||||||
ifp->ifindex, (unsigned long long)ifp->flags,
|
ifp->ifindex, (unsigned long long)ifp->flags,
|
||||||
ifp->metric, ifp->mtu, ifp->speed);
|
ifp->metric, ifp->mtu, ifp->speed, ifp->status);
|
||||||
|
|
||||||
assert(ifp->info);
|
assert(ifp->info);
|
||||||
|
|
||||||
oii = ifp->info;
|
oii = ifp->info;
|
||||||
oii->curr_mtu = ifp->mtu;
|
oii->curr_mtu = ifp->mtu;
|
||||||
|
|
||||||
if (IF_DEF_PARAMS(ifp)
|
/* Change ospf type param based on following
|
||||||
&& !OSPF_IF_PARAM_CONFIGURED(IF_DEF_PARAMS(ifp), type)) {
|
* 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);
|
SET_IF_PARAM(IF_DEF_PARAMS(ifp), type);
|
||||||
IF_DEF_PARAMS(ifp)->type = ospf_default_iftype(ifp);
|
IF_DEF_PARAMS(ifp)->type = ospf_default_iftype(ifp);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user