--- openswan-2.6.29/programs/pluto/ikev1_quick.c	2011-01-27 17:23:01.000000000 +0100
+++ openswan-2.6.29/programs/pluto/ikev1_quick.c	2011-01-27 17:17:09.000000000 +0100
@@ -1240,6 +1231,19 @@
	}
	/* End Hack for MS 818043 NAT-T Update */

+#ifdef NAT_TRAVERSAL
+	/* Hack for MacOS/iPhone */
+	if ((p1st->hidden_variables.st_nat_traversal & NAT_T_DETECTED) &&
+	    (p1st->hidden_variables.st_nat_traversal & LELEM(NAT_TRAVERSAL_OSX))){
+	        char subnet_buf[SUBNETTOT_BUF]; 
+	        subnettot(&p1st->st_remoteaddr, 0, subnet_buf, sizeof(subnet_buf));
+	        happy(addrtosubnet(&p1st->st_remoteaddr, &b.his.net));
+	        loglog(RC_LOG_SERIOUS, "Applying workaround for MacOSX, using remote addr %s as his net"
+	            , subnet_buf);
+	}
+	/* End Hack for MacOS/iPhone */
+#endif
+
	b.his.proto = id_pd->payload.ipsec_id.isaiid_protoid;
	b.his.port = id_pd->payload.ipsec_id.isaiid_port;
	b.his.net.addr.u.v4.sin_port = htons(b.his.port);
