[Vtun-Commit] CVS: The file 'vtun/netlib.c' has been modified.
Status: Inactive
Brought to you by:
mtbishop
|
From: Bishop <mtbishop> - 2009-03-29 10:09:04
|
The following file was modified in vtun:
Name Old version New version Comment
---- ----------- ----------- -------
netlib.c 1.11.2.2 1.11.2.3
The accompanying log:
rfe2636157 - Permit a delayed UDP connection to overcome unpredictable
NAT ports.
The diff of the modified file(s):
--- netlib.c 7 Jan 2008 22:35:56 -0000 1.11.2.2
+++ netlib.c 29 Mar 2009 10:08:59 -0000 1.11.2.3
@@ -190,10 +190,22 @@
}
saddr.sin_port = port;
+
+ /* if the config says to delay the UDP connection, we wait for an
+ incoming packet and then force a connection back. We need to
+ put this here because we need to keep that incoming triggering
+ packet and pass it back up the chain. */
+
+ if (VTUN_USE_NAT_HACK(host))
+ is_rmt_fd_connected=0;
+ else {
if( connect(s,(struct sockaddr *)&saddr,sizeof(saddr)) ){
vtun_syslog(LOG_ERR,"Can't connect socket");
return -1;
}
+ is_rmt_fd_connected=1;
+ }
+
host->sopt.rport = htons(port);
/* Close TCP socket and replace with UDP socket */
|