]> git.saurik.com Git - apple/network_cmds.git/blobdiff - racoon.tproj/isakmp_ident.c
network_cmds-245.11.tar.gz
[apple/network_cmds.git] / racoon.tproj / isakmp_ident.c
index ca55619129ca50d3c357a221d748f9a1bc155ba3..6ed424f31c7a443a394b00bf7ba88ff1313d943c 100644 (file)
@@ -1649,10 +1649,17 @@ ident_ir2mx(iph1)
 
 #ifdef IKE_NAT_T
        if (natd_type) {
-               if (iph1->local_natd)
-                       p = set_isakmp_payload(p, iph1->local_natd, natd_type);
-               if (iph1->remote_natd)
-                       p = set_isakmp_payload(p, iph1->remote_natd, ISAKMP_NPTYPE_NONE);
+               if ((iph1->natt_flags & NATT_TYPE_MASK) == natt_type_apple) {
+                       if (iph1->local_natd)
+                               p = set_isakmp_payload(p, iph1->local_natd, natd_type);
+                       if (iph1->remote_natd)
+                               p = set_isakmp_payload(p, iph1->remote_natd, ISAKMP_NPTYPE_NONE);
+               } else {
+                       if (iph1->remote_natd)
+                               p = set_isakmp_payload(p, iph1->remote_natd, natd_type);
+                       if (iph1->local_natd)
+                               p = set_isakmp_payload(p, iph1->local_natd, ISAKMP_NPTYPE_NONE);
+               }
        }
 #endif
        error = 0;