]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUG] standard: is_addr return value for IPv4 was inverted
authorDavid du Colombier <dducolombier@exceliance.fr>
Tue, 22 Mar 2011 10:39:41 +0000 (11:39 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 22 Mar 2011 13:39:16 +0000 (14:39 +0100)
include/common/standard.h

index 712d941286a44992db302f59315e63bb8b589b6e..7cfd5e225b4e8724b34f0b9694d73b72f847aeb4 100644 (file)
@@ -475,7 +475,7 @@ static inline int is_addr(struct sockaddr_storage *addr)
 
        switch (addr->ss_family) {
        case AF_INET:
-               return *(int *)&((struct sockaddr_in *)&addr)->sin_addr;
+               return *(int *)&((struct sockaddr_in *)addr)->sin_addr;
        case AF_INET6:
                for (i = 0; i < sizeof(struct in6_addr) / sizeof(int); i++)
                        if (((int *)&((struct sockaddr_in6 *)addr)->sin6_addr)[i] != 0)