git: 87c5ff0648a8 - main - cxgbe/iw_cxgbe: c4iw_zero_addr should not use IN_ZERONET.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 19 May 2022 22:58:26 UTC
The branch main has been updated by np:
URL: https://cgit.FreeBSD.org/src/commit/?id=87c5ff0648a8e88b71a66994e1f9ca127fd4ed83
commit 87c5ff0648a8e88b71a66994e1f9ca127fd4ed83
Author: Navdeep Parhar <np@FreeBSD.org>
AuthorDate: 2022-05-19 19:25:30 +0000
Commit: Navdeep Parhar <np@FreeBSD.org>
CommitDate: 2022-05-19 22:55:08 +0000
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
---
sys/dev/cxgbe/iw_cxgbe/cm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sys/dev/cxgbe/iw_cxgbe/cm.c b/sys/dev/cxgbe/iw_cxgbe/cm.c
index 93d824730735..31a401c8ef48 100644
--- a/sys/dev/cxgbe/iw_cxgbe/cm.c
+++ b/sys/dev/cxgbe/iw_cxgbe/cm.c
@@ -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] |