[Vtun-Commit] CVS: The file 'vtun/cfg_file.y' has been modified.
Status: Inactive
Brought to you by:
mtbishop
|
From: Bishop <mtbishop> - 2009-03-29 10:08:44
|
The following file was modified in vtun:
Name Old version New version Comment
---- ----------- ----------- -------
cfg_file.y 1.8.2.3 1.8.2.4
The accompanying log:
rfe2636157 - Permit a delayed UDP connection to overcome unpredictable
NAT ports.
The diff of the modified file(s):
--- cfg_file.y 8 Dec 2008 13:01:23 -0000 1.8.2.3
+++ cfg_file.y 29 Mar 2009 10:08:39 -0000 1.8.2.4
@@ -74,7 +74,7 @@
%token K_OPTIONS K_DEFAULT K_PORT K_BINDADDR K_PERSIST K_TIMEOUT
%token K_PASSWD K_PROG K_PPP K_SPEED K_IFCFG K_FWALL K_ROUTE K_DEVICE
%token K_MULTI K_SRCADDR K_IFACE K_ADDR
-%token K_TYPE K_PROT K_COMPRESS K_ENCRYPT K_KALIVE K_STAT
+%token K_TYPE K_PROT K_NAT_HACK K_COMPRESS K_ENCRYPT K_KALIVE K_STAT
%token K_UP K_DOWN K_SYSLOG K_IPROUTE
%token <str> K_HOST K_ERROR
@@ -321,6 +321,15 @@
parse_host->flags |= $2;
}
+ | K_NAT_HACK NUM {
+ #ifdef ENABLE_NAT_HACK
+ parse_host->flags &= ~VTUN_NAT_HACK_MASK;
+ parse_host->flags |= $2;
+ #else
+ cfg_error("This vtund binary was built with the NAT hack disabled for security purposes.");
+ #endif
+ }
+
| K_SRCADDR '{' srcaddr_options '}'
| K_UP {
@@ -587,6 +596,27 @@
return (struct vtun_host *)llist_free(&host_list, free_host, host);
}
+int clear_nat_hack_server(void *d, void *u)
+{
+ ((struct vtun_host*)d)->flags &= ~VTUN_NAT_HACK_CLIENT;
+ return 0;
+}
+
+int clear_nat_hack_client(void *d, void *u)
+{
+ ((struct vtun_host*)d)->flags &= ~VTUN_NAT_HACK_SERVER;
+ return 0;
+}
+
+/* Clear the VTUN_NAT_HACK flag which are not relevant to the current operation mode */
+inline void clear_nat_hack_flags(int svr)
+{
+ if (svr)
+ llist_trav(&host_list,clear_nat_hack_server,NULL);
+ else
+ llist_trav(&host_list,clear_nat_hack_client,NULL);
+}
+
inline void free_host_list(void)
{
llist_free(&host_list, free_host, NULL);
|