From c2cffffb3797586992687ac00c1544aed4ce6d63 Mon Sep 17 00:00:00 2001 From: Gaurav Goyal Date: Thu, 11 Mar 2021 16:40:14 +1300 Subject: [PATCH] nhrpd: Add CIE to NAT extension in resolution requests Signed-off-by: Reuben Dowle --- nhrpd/nhrp_shortcut.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nhrpd/nhrp_shortcut.c b/nhrpd/nhrp_shortcut.c index adc878d1e0..56a6699445 100644 --- a/nhrpd/nhrp_shortcut.c +++ b/nhrpd/nhrp_shortcut.c @@ -377,6 +377,7 @@ static void nhrp_shortcut_send_resolution_req(struct nhrp_shortcut *s) struct nhrp_afi_data *if_ad; struct nhrp_peer *peer; struct nhrp_cie_header *cie; + struct nhrp_extension_header *ext; if (nhrp_route_address(NULL, &s->addr, NULL, &peer) != NHRP_ROUTE_NBMA_NEXTHOP) @@ -420,7 +421,13 @@ static void nhrp_shortcut_send_resolution_req(struct nhrp_shortcut *s) /* Cisco NAT detection extension */ hdr->flags |= htons(NHRP_FLAG_RESOLUTION_NAT); - nhrp_ext_push(zb, hdr, NHRP_EXTENSION_NAT_ADDRESS); + ext = nhrp_ext_push(zb, hdr, NHRP_EXTENSION_NAT_ADDRESS); + if (sockunion_family(&nifp->nat_nbma) != AF_UNSPEC) + { + nhrp_cie_push(zb, NHRP_CODE_SUCCESS, + &nifp->nat_nbma, &nifp->afi[family2afi(sockunion_family(&s->addr))].addr); + nhrp_ext_complete(zb, ext); + } nhrp_packet_complete(zb, hdr); -- 2.39.5