cxgb4: fix all-mask IP address comparison
[ Upstream commit 76c4d85c9260c3d741cbd194c30c61983d0a4303 ] Convert all-mask IP address to Big Endian, instead, for comparison. Fixes: f286dd8eaad5 ("cxgb4: use correct type for all-mask IP address comparison") Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
2a4c5ff12f
commit
97d6855ac5
@ -839,16 +839,16 @@ static bool is_addr_all_mask(u8 *ipmask, int family)
|
||||
struct in_addr *addr;
|
||||
|
||||
addr = (struct in_addr *)ipmask;
|
||||
if (ntohl(addr->s_addr) == 0xffffffff)
|
||||
if (addr->s_addr == htonl(0xffffffff))
|
||||
return true;
|
||||
} else if (family == AF_INET6) {
|
||||
struct in6_addr *addr6;
|
||||
|
||||
addr6 = (struct in6_addr *)ipmask;
|
||||
if (ntohl(addr6->s6_addr32[0]) == 0xffffffff &&
|
||||
ntohl(addr6->s6_addr32[1]) == 0xffffffff &&
|
||||
ntohl(addr6->s6_addr32[2]) == 0xffffffff &&
|
||||
ntohl(addr6->s6_addr32[3]) == 0xffffffff)
|
||||
if (addr6->s6_addr32[0] == htonl(0xffffffff) &&
|
||||
addr6->s6_addr32[1] == htonl(0xffffffff) &&
|
||||
addr6->s6_addr32[2] == htonl(0xffffffff) &&
|
||||
addr6->s6_addr32[3] == htonl(0xffffffff))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user