[Ttssh2-commit] [7197] AF_UNSPEC時、不定値使用の修正

scmno****@osdn***** scmno****@osdn*****
2018年 8月 27日 (月) 23:24:15 JST


Revision: 7197
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7197
Author:   zmatsuo
Date:     2018-08-27 23:24:15 +0900 (Mon, 27 Aug 2018)
Log Message:
-----------
AF_UNSPEC時、不定値使用の修正
AF_INET6時、in6addr_anyで初期化

Modified Paths:
--------------
    trunk/ttssh2/ttxssh/ttxssh.c

-------------- next part --------------
Modified: trunk/ttssh2/ttxssh/ttxssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.c	2018-08-27 14:20:40 UTC (rev 7196)
+++ trunk/ttssh2/ttxssh/ttxssh.c	2018-08-27 14:24:15 UTC (rev 7197)
@@ -759,13 +759,14 @@
 		case AF_INET6:
 			len = sizeof(struct sockaddr_in6);
 			((struct sockaddr_in6 *) &ss)->sin6_family = AF_INET6;
-			memset(&((struct sockaddr_in6 *) &ss)->sin6_addr, 0,
-			       sizeof(struct in_addr6));
+			((struct sockaddr_in6 *) &ss)->sin6_addr = in6addr_any;
 			((struct sockaddr_in6 *) &ss)->sin6_port =
 				htons(find_local_port(pvar));
 			break;
 		default:
 			/* UNSPEC */
+			len = sizeof(ss);
+			ss.ss_family = AF_UNSPEC;
 			break;
 		}
 



Ttssh2-commit メーリングリストの案内