diff --git a/trick_source/trick_utils/comm/src/tc_accept.c b/trick_source/trick_utils/comm/src/tc_accept.c index f8c529c7..bf8b8dcd 100644 --- a/trick_source/trick_utils/comm/src/tc_accept.c +++ b/trick_source/trick_utils/comm/src/tc_accept.c @@ -11,7 +11,6 @@ #include "dmtcpaware.h" #endif -static struct sockaddr_in s_in; int tc_accept_(TCDevice * listen_device, TCDevice * device, const char *file, int line) { @@ -24,7 +23,9 @@ int tc_accept_(TCDevice * listen_device, TCDevice * device, const char *file, in char *ptrL; char client_str[TC_TAG_LENGTH + 256]; unsigned char byte_info[TC_BYTE_INFO_LENGTH]; + struct sockaddr_in s_in; + memset(&s_in, 0, sizeof(struct sockaddr_in)) ; /* Accept On Listen Device */ length = sizeof(s_in); #if _DMTCP diff --git a/trick_source/trick_utils/comm/src/tc_init.c b/trick_source/trick_utils/comm/src/tc_init.c index fd6589ce..9ac3e606 100644 --- a/trick_source/trick_utils/comm/src/tc_init.c +++ b/trick_source/trick_utils/comm/src/tc_init.c @@ -11,7 +11,6 @@ int tc_init(TCDevice * listen_device) { return tc_init_with_connection_info( listen_device, TRICKCOMM_SOCKET_FAMILY, SOCK_STREAM, NULL, listen_device->port ) ; } -static struct sockaddr_in s_in; int tc_init_with_connection_info( TCDevice * listen_device, int domain, @@ -23,11 +22,14 @@ int tc_init_with_connection_info( TCDevice * listen_device, int on = 1; //struct sockaddr_in s_in; struct hostent *ip_host ; + struct sockaddr_in s_in; #ifdef __WIN32__ WSADATA wsaData; #endif + memset(&s_in, 0, sizeof(struct sockaddr_in)) ; + if (!listen_device) { TrickErrorHndlr *temp_error_hndlr = NULL; trick_error_report(temp_error_hndlr, TRICK_ERROR_ALERT, __FILE__, __LINE__, "Listen device is null."); diff --git a/trick_source/trick_utils/comm/src/tc_init_udp_client.c b/trick_source/trick_utils/comm/src/tc_init_udp_client.c index 780e3665..857eb055 100644 --- a/trick_source/trick_utils/comm/src/tc_init_udp_client.c +++ b/trick_source/trick_utils/comm/src/tc_init_udp_client.c @@ -16,7 +16,6 @@ #include "../include/tc.h" #include "../include/tc_proto.h" -static struct sockaddr_in sockin; #ifndef STAND_ALONE extern int send_hs(FILE * fp, char *format, ...); #endif @@ -30,6 +29,9 @@ int tc_init_udp_client(TCDevice * udp_client_device) int on = 1; struct hostent *h; int the_socket; + struct sockaddr_in sockin; + + memset(&sockin, 0 , sizeof(struct sockaddr_in)) ; if (!udp_client_device) { trick_error_report(udp_client_device->error_handler,