cxgbe/iw_cxgbe: c4iw_zero_addr should not use IN_ZERONET.
c4iw_zero_addr is supposed to check for all-zero addresses but was using IN_ZERONET (which does something different) for IPv4 addresses. Fix it by simply checking for 0 as is done for IPv6 addresses. Reported by: karels@ MFC after: 3 days Sponsored by: Chelsio Communications
This commit is contained in:
parent
e343ebbfbe
commit
87c5ff0648
@ -938,8 +938,7 @@ static inline int c4iw_zero_addr(struct sockaddr *addr)
|
||||
struct in6_addr *ip6;
|
||||
|
||||
if (addr->sa_family == AF_INET)
|
||||
return IN_ZERONET(
|
||||
ntohl(((struct sockaddr_in *)addr)->sin_addr.s_addr));
|
||||
return (((struct sockaddr_in *)addr)->sin_addr.s_addr == 0);
|
||||
else {
|
||||
ip6 = &((struct sockaddr_in6 *) addr)->sin6_addr;
|
||||
return (ip6->s6_addr32[0] | ip6->s6_addr32[1] |
|
||||
|
Loading…
x
Reference in New Issue
Block a user