summaryrefslogtreecommitdiffstats
path: root/nhrpd/nhrp_shortcut.c
diff options
context:
space:
mode:
authorGaurav Goyal <gaurav.goyal@4rf.com>2021-03-11 04:40:14 +0100
committerReuben Dowle <reuben.dowle@4rf.com>2021-03-18 04:35:41 +0100
commitc2cffffb3797586992687ac00c1544aed4ce6d63 (patch)
treede377a2dfc0fc876541e9503141cb6d8ba0ac0a1 /nhrpd/nhrp_shortcut.c
parentnhrpd: Add NAT extension in forwarded packets (diff)
downloadfrr-c2cffffb3797586992687ac00c1544aed4ce6d63.tar.xz
frr-c2cffffb3797586992687ac00c1544aed4ce6d63.zip
nhrpd: Add CIE to NAT extension in resolution requests
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
Diffstat (limited to 'nhrpd/nhrp_shortcut.c')
-rw-r--r--nhrpd/nhrp_shortcut.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/nhrpd/nhrp_shortcut.c b/nhrpd/nhrp_shortcut.c
index adc878d1e..56a669944 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);