Merge pull request #13605 from anlancs/fix/pimd-promote-interface

pimd: Fix missing promotion for primary address
This commit is contained in:
Donald Sharp 2023-07-20 08:16:17 -04:00 committed by GitHub
commit 59742b4550
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -890,6 +890,7 @@ pim_addr pim_find_primary_addr(struct interface *ifp)
#else
int v4_addrs = 0;
int v6_addrs = 0;
struct connected *promote_ifc = NULL;
for (ALL_LIST_ELEMENTS_RO(ifp->connected, node, ifc)) {
switch (ifc->address->family) {
@ -903,15 +904,24 @@ pim_addr pim_find_primary_addr(struct interface *ifp)
continue;
}
if (CHECK_FLAG(ifc->flags, ZEBRA_IFA_SECONDARY))
continue;
if (ifc->address->family != PIM_AF)
continue;
if (CHECK_FLAG(ifc->flags, ZEBRA_IFA_SECONDARY)) {
promote_ifc = ifc;
continue;
}
return pim_addr_from_prefix(ifc->address);
}
/* Promote the new primary address. */
if (v4_addrs && promote_ifc) {
UNSET_FLAG(promote_ifc->flags, ZEBRA_IFA_SECONDARY);
return pim_addr_from_prefix(promote_ifc->address);
}
/*
* If we have no v4_addrs and v6 is configured
* We probably are using unnumbered