diff options
author | Sarita Patra <saritap@vmware.com> | 2022-09-23 09:08:23 +0200 |
---|---|---|
committer | Sarita Patra <saritap@vmware.com> | 2022-09-30 12:35:49 +0200 |
commit | 6ea2a7fb4fdf3c52c700d9447e0a34a6dd87b719 (patch) | |
tree | 7fcecc332eba929639cca061b61140f928cee4cd /pimd/pim_tlv.c | |
parent | Merge pull request #11958 from AbhishekNR/ttable_show (diff) | |
download | frr-6ea2a7fb4fdf3c52c700d9447e0a34a6dd87b719.tar.xz frr-6ea2a7fb4fdf3c52c700d9447e0a34a6dd87b719.zip |
pimd, pim6d: send secondary address in PIM hello packet
Fixed as per rfc7761 section 4.3.1.
"""
Sending Hello Messages
The Address List option advertises all the secondary addresses
associated with the source interface of the router originating the
message. The option MUST be included in all Hello messages if there
are secondary addresses associated with the source interface and MAY
be omitted if no secondary addresses exist.
"""
Issue: #12015
Signed-off-by: Sarita Patra <saritap@vmware.com>
Diffstat (limited to 'pimd/pim_tlv.c')
-rw-r--r-- | pimd/pim_tlv.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/pimd/pim_tlv.c b/pimd/pim_tlv.c index 65975ce14..c9caf0016 100644 --- a/pimd/pim_tlv.c +++ b/pimd/pim_tlv.c @@ -29,6 +29,8 @@ #include "pim_tlv.h" #include "pim_str.h" #include "pim_msg.h" +#include "pim_iface.h" +#include "pim_addr.h" #if PIM_IPV == 4 #define PIM_MSG_ADDRESS_FAMILY PIM_MSG_ADDRESS_FAMILY_IPV4 @@ -226,12 +228,15 @@ int pim_encode_addr_group(uint8_t *buf, afi_t afi, int bidir, int scope, } uint8_t *pim_tlv_append_addrlist_ucast(uint8_t *buf, const uint8_t *buf_pastend, - struct list *ifconnected, int family) + struct interface *ifp, int family) { struct listnode *node; uint16_t option_len = 0; uint8_t *curr; size_t uel; + struct list *ifconnected = ifp->connected; + struct pim_interface *pim_ifp = ifp->info; + pim_addr addr; node = listhead(ifconnected); @@ -252,7 +257,10 @@ uint8_t *pim_tlv_append_addrlist_ucast(uint8_t *buf, const uint8_t *buf_pastend, struct prefix *p = ifc->address; int l_encode; - if (!CHECK_FLAG(ifc->flags, ZEBRA_IFA_SECONDARY)) + addr = pim_addr_from_prefix(p); + if (!pim_addr_cmp(pim_ifp->primary_address, addr)) + /* don't add the primary address + * into the secondary address list */ continue; if ((curr + uel) > buf_pastend) |