diff --git a/src/WINNT/afsd/cm_conn.c b/src/WINNT/afsd/cm_conn.c index a5cbd56bee..d3e38024a1 100644 --- a/src/WINNT/afsd/cm_conn.c +++ b/src/WINNT/afsd/cm_conn.c @@ -27,6 +27,7 @@ DWORD RDRtimeout = CM_CONN_DEFAULTRDRTIMEOUT; unsigned short ConnDeadtimeout = CM_CONN_CONNDEADTIME; unsigned short HardDeadtimeout = CM_CONN_HARDDEADTIME; unsigned short IdleDeadtimeout = CM_CONN_IDLEDEADTIME; +unsigned short NatPingInterval = CM_CONN_NATPINGINTERVAL; #define LANMAN_WKS_PARAM_KEY "SYSTEM\\CurrentControlSet\\Services\\lanmanworkstation\\parameters" #define LANMAN_WKS_SESSION_TIMEOUT "SessTimeout" @@ -121,6 +122,13 @@ void cm_InitConn(void) IdleDeadtimeout = (unsigned short)dwValue; afsi_log("IdleDeadTimeout is %d", IdleDeadtimeout); } + dummyLen = sizeof(DWORD); + code = RegQueryValueEx(parmKey, "NatPingInterval", NULL, NULL, + (BYTE *) &dwValue, &dummyLen); + if (code == ERROR_SUCCESS) { + NatPingInterval = (unsigned short)dwValue; + } + afsi_log("NatPingInterval is %d", NatPingInterval); RegCloseKey(parmKey); } @@ -1103,6 +1111,8 @@ static void cm_NewRXConnection(cm_conn_t *tcp, cm_ucell_t *ucellp, rx_SetConnDeadTime(tcp->rxconnp, ConnDeadtimeout); rx_SetConnHardDeadTime(tcp->rxconnp, HardDeadtimeout); rx_SetConnIdleDeadTime(tcp->rxconnp, IdleDeadtimeout); + if (NatPingInterval) + rx_SetConnSecondsUntilNatPing(tcp->rxconnp, NatPingInterval); tcp->ucgen = ucellp->gen; if (secObjp) rxs_Release(secObjp); /* Decrement the initial refCount */ diff --git a/src/WINNT/afsd/cm_conn.h b/src/WINNT/afsd/cm_conn.h index 5e0b6732a2..c80c8b518a 100644 --- a/src/WINNT/afsd/cm_conn.h +++ b/src/WINNT/afsd/cm_conn.h @@ -20,6 +20,9 @@ #ifndef CM_CONN_IDLEDEADTIME #define CM_CONN_IDLEDEADTIME 0 #endif +#ifndef CM_CONN_NATPINGINTERVAL +#define CM_CONN_NATPINGINTERVAL 0 +#endif extern unsigned short ConnDeadtimeout; extern unsigned short HardDeadtimeout; diff --git a/src/libafsrpc/afsrpc.def b/src/libafsrpc/afsrpc.def index 015023ae42..d4f2682746 100755 --- a/src/libafsrpc/afsrpc.def +++ b/src/libafsrpc/afsrpc.def @@ -258,6 +258,7 @@ EXPORTS xdr_serverList @263 xdr_Capabilities @264 xdrlen_create @265 + rx_SetConnSecondsUntilNatPing @266 ; for performance testing rx_TSFPQGlobSize @2001 DATA