diff options
author | Donald Sharp <donaldsharp72@gmail.com> | 2023-07-20 14:16:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-20 14:16:17 +0200 |
commit | 59742b4550aa54941cf86f5c03f82305bbc7c718 (patch) | |
tree | d84e4bfb6099481e3819f274b54fe64205dc3703 /pimd | |
parent | Merge pull request #14026 from LabNConsulting/pbr-add-vlan-filters (diff) | |
parent | pimd: Fix missing promotion for primary address (diff) | |
download | frr-59742b4550aa54941cf86f5c03f82305bbc7c718.tar.xz frr-59742b4550aa54941cf86f5c03f82305bbc7c718.zip |
Merge pull request #13605 from anlancs/fix/pimd-promote-interface
pimd: Fix missing promotion for primary address
Diffstat (limited to 'pimd')
-rw-r--r-- | pimd/pim_iface.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c index 7340eeaa6..85e0fdf3a 100644 --- a/pimd/pim_iface.c +++ b/pimd/pim_iface.c @@ -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)) + if (ifc->address->family != PIM_AF) continue; - if (ifc->address->family != PIM_AF) + 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 |