lib: Fix a pointless error check
authorVolker Lendecke <vl@samba.org>
Fri, 29 Jul 2016 08:54:39 +0000 (10:54 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 5 Aug 2016 20:20:05 +0000 (22:20 +0200)
According to susv4, addr.s6_addr is a

uint8_t s6_addr[16]

which is always != 0

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
source4/lib/socket/socket_ip.c

index d531053add354befe633a1a06935b6fbc471bd10..6ec525265a75b32b70eb67ea77b1017bb2f2b01a 100644 (file)
@@ -861,7 +861,8 @@ static NTSTATUS ipv6_sendto(struct socket_context *sock,
                
                ZERO_STRUCT(srv_addr);
                addr                     = interpret_addr6(dest_addr->addr);
-               if (addr.s6_addr == 0) {
+               if (memcmp(&addr.s6_addr, &in6addr_any,
+                          sizeof(addr.s6_addr)) == 0) {
                        return NT_STATUS_HOST_UNREACHABLE;
                }
                srv_addr.sin6_addr = addr;