[PATCH 2/3] ssl: Fix memcmp() IPv6 address size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



clang spotted the misplaced parentheses:

    ssl.c:120:72: warning: size argument in 'memcmp' call is a comparison
          [-Wmemsize-comparison]
      ...!memcmp(&a6->sin6_addr, &b6->sin6_addr, sizeof(a6->sin6_addr) &&
                                                 ~~~~~~~~~~~~~~~~~~~~~~^~

Signed-off-by: Kevin Cernekee <cernekee at gmail.com>
---
 ssl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ssl.c b/ssl.c
index d47a819..d22ebd3 100644
--- a/ssl.c
+++ b/ssl.c
@@ -117,8 +117,8 @@ static int match_sockaddr(struct sockaddr *a, struct sockaddr *b)
 	} else if (a->sa_family == AF_INET6) {
 		struct sockaddr_in6 *a6 = (void *)a;
 		struct sockaddr_in6 *b6 = (void *)b;
-		return !memcmp(&a6->sin6_addr, &b6->sin6_addr, sizeof(a6->sin6_addr) &&
-			       a6->sin6_port == b6->sin6_port);
+		return !memcmp(&a6->sin6_addr, &b6->sin6_addr, sizeof(a6->sin6_addr)) &&
+		       a6->sin6_port == b6->sin6_port;
 	} else
 		return 0;
 }
-- 
2.1.1




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux