]> git.proxmox.com Git - mirror_frr.git/commitdiff
nhrpd: Set prefix correctly in resolution request
authorAmol Lad <amol.lad@4rf.com>
Wed, 24 Mar 2021 03:38:20 +0000 (16:38 +1300)
committerReuben Dowle <reuben.dowle@4rf.com>
Tue, 18 May 2021 02:27:05 +0000 (14:27 +1200)
RFC2332 requires prefix length be 0xFF only when uniqueness bit is set.

Without this change Cisco spokes will reject resolution request messages

Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
nhrpd/nhrp_shortcut.c

index 56861551eae54eac0b267cdf1cb9542f6ee2e82c..0905ceb72a4bcfa015a67e1d3e1d5e9bee1f4e2b 100644 (file)
@@ -427,8 +427,10 @@ static void nhrp_shortcut_send_resolution_req(struct nhrp_shortcut *s)
         * */
        /* FIXME: push CIE for each local protocol address */
        cie = nhrp_cie_push(zb, NHRP_CODE_SUCCESS, NULL, NULL);
-       cie->prefix_length = 0xff;
        if_ad = &nifp->afi[family2afi(sockunion_family(&s->addr))];
+       cie->prefix_length = (if_ad->flags & NHRP_IFF_REG_NO_UNIQUE)
+                               ? 8 * sockunion_get_addrlen(&s->addr)
+                               : 0xff;
        cie->holding_time = htons(if_ad->holdtime);
        cie->mtu = htons(if_ad->mtu);
        debugf(NHRP_DEBUG_COMMON,