From 5e70e83b9e2bfd90b18beaa1a711a159155dd6b2 Mon Sep 17 00:00:00 2001 From: Amol Lad Date: Wed, 24 Feb 2021 15:21:45 +0530 Subject: nhrpd: Add empty NAT extension header for Non Natted Spoke in Resolution-Reply Signed-off-by: Reuben Dowle --- nhrpd/nhrp_peer.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'nhrpd/nhrp_peer.c') 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) -- cgit v1.2.3