From 802563fd38d10a9233aa60ac5ac50ae3bd15a7ad Mon Sep 17 00:00:00 2001
From: Vadim Penzin <vadimp@users.sf.net>
Date: Tue, 28 Oct 2014 22:53:28 -0400
Subject: [PATCH 05/28] Fixed the wrong type used while comparing IPv6
 addresses

src/tcs/rpc/tcstp/rpc.c:access_control() checks if peer's address
is in6addr_loopback. memcmp(3) is passed sizeof(struct sockaddr_in6)
that is larger than sizeof(struct in6_addr), so the call always fails.

From https://sourceforge.net/p/trousers/trousers/ci/802563fd38d10a9233aa60ac5ac50ae3bd15a7ad/
---
 src/tcs/rpc/tcstp/rpc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tcs/rpc/tcstp/rpc.c b/src/tcs/rpc/tcstp/rpc.c
index 1573a8a..08deb84 100644
--- a/src/tcs/rpc/tcstp/rpc.c
+++ b/src/tcs/rpc/tcstp/rpc.c
@@ -543,7 +543,7 @@ access_control(struct tcsd_thread_data *thread_data)
 	else if (sa->sa_family == AF_INET6) {
 		struct sockaddr_in6 *sa_in6 = (struct sockaddr_in6 *)sa;
 		if (memcmp(&sa_in6->sin6_addr.s6_addr, &in6addr_loopback,
-					sizeof(struct sockaddr_in6)) == 0)
+					sizeof(struct in6_addr)) == 0)
 			is_localhost = 1;
 	}
 
-- 
1.8.3.1

