Skip to content

Commit 76c4d85

Browse files
chelsiocudbgdavem330
authored andcommitted
cxgb4: fix all-mask IP address comparison
Convert all-mask IP address to Big Endian, instead, for comparison. Fixes: f286dd8 ("cxgb4: use correct type for all-mask IP address comparison") Signed-off-by: Rahul Lakkireddy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a34f829 commit 76c4d85

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,16 +1112,16 @@ static bool is_addr_all_mask(u8 *ipmask, int family)
11121112
struct in_addr *addr;
11131113

11141114
addr = (struct in_addr *)ipmask;
1115-
if (ntohl(addr->s_addr) == 0xffffffff)
1115+
if (addr->s_addr == htonl(0xffffffff))
11161116
return true;
11171117
} else if (family == AF_INET6) {
11181118
struct in6_addr *addr6;
11191119

11201120
addr6 = (struct in6_addr *)ipmask;
1121-
if (ntohl(addr6->s6_addr32[0]) == 0xffffffff &&
1122-
ntohl(addr6->s6_addr32[1]) == 0xffffffff &&
1123-
ntohl(addr6->s6_addr32[2]) == 0xffffffff &&
1124-
ntohl(addr6->s6_addr32[3]) == 0xffffffff)
1121+
if (addr6->s6_addr32[0] == htonl(0xffffffff) &&
1122+
addr6->s6_addr32[1] == htonl(0xffffffff) &&
1123+
addr6->s6_addr32[2] == htonl(0xffffffff) &&
1124+
addr6->s6_addr32[3] == htonl(0xffffffff))
11251125
return true;
11261126
}
11271127
return false;

0 commit comments

Comments
 (0)