[Vtun-Commit] CVS: The file 'vtun/netlib.c' has been modified.
Status: Inactive
Brought to you by:
mtbishop
|
From: Bishop <mtbishop> - 2009-03-03 04:15:30
|
The following file was modified in vtun:
Name Old version New version Comment
---- ----------- ----------- -------
netlib.c 1.11.2.2 1.11.2.2.4.1
The accompanying log:
Initial check-in of Delayed UDP (Nat Hack) feature for working with
unpleasant NATs, submitted by Dragos Vingarzan (rfe2636157)
The diff of the modified file(s):
--- netlib.c 7 Jan 2008 22:35:56 -0000 1.11.2.2
+++ netlib.c 3 Mar 2009 04:15:27 -0000 1.11.2.2.4.1
@@ -138,6 +138,7 @@
return addr.sin_addr.s_addr;
}
+int is_rmt_fd_connected=1;
/*
* Establish UDP session with host connected to fd(socket).
* Returns connected UDP socket or -1 on error.
@@ -190,10 +191,16 @@
}
saddr.sin_port = port;
+ 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 */
|