Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Feb 2023 07:39:32 GMT
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: d3be047579fd - stable/13 - cxgbe/iw_cxgbe: c4iw_zero_addr should not use IN_ZERONET.
Message-ID:  <202302020739.3127dWbw062033@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by np:

URL: https://cgit.FreeBSD.org/src/commit/?id=d3be047579fddd6ec462b17676c87adfab205502

commit d3be047579fddd6ec462b17676c87adfab205502
Author:     Navdeep Parhar <np@FreeBSD.org>
AuthorDate: 2022-05-19 19:25:30 +0000
Commit:     Navdeep Parhar <np@FreeBSD.org>
CommitDate: 2023-02-02 07:14:48 +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@
    Sponsored by:   Chelsio Communications
    
    (cherry picked from commit 87c5ff0648a8e88b71a66994e1f9ca127fd4ed83)
---
 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 6d29116ff1bb..19ec920f48c7 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] |



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202302020739.3127dWbw062033>