diff tcp-accept.c @ 1411:798854f62430 fuzz

merge from main
author Matt Johnston <matt@ucc.asn.au>
date Wed, 14 Jun 2017 23:31:42 +0800
parents ae6887d9ab46
children 58a74cb829b8
line wrap: on
line diff
--- a/tcp-accept.c	Sun Jun 11 21:39:40 2017 +0800
+++ b/tcp-accept.c	Wed Jun 14 23:31:42 2017 +0800
@@ -55,19 +55,19 @@
 static void tcp_acceptor(struct Listener *listener, int sock) {
 
 	int fd;
-	struct sockaddr_storage addr;
+	struct sockaddr_storage sa;
 	socklen_t len;
 	char ipstring[NI_MAXHOST], portstring[NI_MAXSERV];
 	struct TCPListener *tcpinfo = (struct TCPListener*)(listener->typedata);
 
-	len = sizeof(addr);
+	len = sizeof(sa);
 
-	fd = accept(sock, (struct sockaddr*)&addr, &len);
+	fd = accept(sock, (struct sockaddr*)&sa, &len);
 	if (fd < 0) {
 		return;
 	}
 
-	if (getnameinfo((struct sockaddr*)&addr, len, ipstring, sizeof(ipstring),
+	if (getnameinfo((struct sockaddr*)&sa, len, ipstring, sizeof(ipstring),
 				portstring, sizeof(portstring), 
 				NI_NUMERICHOST | NI_NUMERICSERV) != 0) {
 		m_close(fd);