summaryrefslogtreecommitdiffstats
path: root/nhrpd
diff options
context:
space:
mode:
authorAmol Lad <amol.lad@4rf.com>2021-02-24 10:51:45 +0100
committerReuben Dowle <reuben.dowle@4rf.com>2021-03-18 04:35:41 +0100
commit5e70e83b9e2bfd90b18beaa1a711a159155dd6b2 (patch)
treea958ac8f5239c65581cd3e204cef3e1aef21b179 /nhrpd
parentnhrpd: Set correct MTU in NHRP extensions (diff)
downloadfrr-5e70e83b9e2bfd90b18beaa1a711a159155dd6b2.tar.xz
frr-5e70e83b9e2bfd90b18beaa1a711a159155dd6b2.zip
nhrpd: Add empty NAT extension header for Non Natted Spoke in Resolution-Reply
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
Diffstat (limited to 'nhrpd')
-rw-r--r--nhrpd/nhrp_peer.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/nhrpd/nhrp_peer.c b/nhrpd/nhrp_peer.c
index ac64b791f..3395a685e 100644
--- a/nhrpd/nhrp_peer.c
+++ b/nhrpd/nhrp_peer.c
@@ -569,20 +569,18 @@ static void nhrp_handle_resolution_req(struct nhrp_packet_parser *pp)
while ((ext = nhrp_ext_pull(&pp->extensions, &payload)) != NULL) {
switch (htons(ext->type) & ~NHRP_EXTENSION_FLAG_COMPULSORY) {
case NHRP_EXTENSION_NAT_ADDRESS:
-
- if (sockunion_family(&nifp->nat_nbma) == AF_UNSPEC)
- break;
-
ext = nhrp_ext_push(zb, hdr,
NHRP_EXTENSION_NAT_ADDRESS);
if (!ext)
goto err;
- cie = nhrp_cie_push(zb, NHRP_CODE_SUCCESS,
+ if (sockunion_family(&nifp->nat_nbma) != AF_UNSPEC) {
+ cie = nhrp_cie_push(zb, NHRP_CODE_SUCCESS,
&nifp->nat_nbma, &pp->if_ad->addr);
- if (!cie)
- goto err;
- cie->mtu = htons(pp->if_ad->mtu);
- nhrp_ext_complete(zb, ext);
+ if (!cie)
+ goto err;
+ cie->mtu = htons(pp->if_ad->mtu);
+ nhrp_ext_complete(zb, ext);
+ }
break;
default:
if (nhrp_ext_reply(zb, hdr, ifp, ext, &payload) < 0)