]> git.puffer.fish Git - matthieu/frr.git/commitdiff
nhrpd: Add empty NAT extension header for Non Natted Spoke in Resolution-Reply
authorAmol Lad <amol.lad@4rf.com>
Wed, 24 Feb 2021 09:51:45 +0000 (15:21 +0530)
committerReuben Dowle <reuben.dowle@4rf.com>
Thu, 18 Mar 2021 03:35:41 +0000 (16:35 +1300)
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
nhrpd/nhrp_peer.c

index ac64b791ff097fdb9648c7199de48eebda0eb3ba..3395a685ebf30dc885f09ab557b4288e23ba139a 100644 (file)
@@ -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)