Skip to content

Commit

Permalink
IB/core: Fix endianness annotation in rdma_is_multicast_addr()
Browse files Browse the repository at this point in the history
Since ipv4_addr is a big endian 32-bit number, annotate it as such.

Fixes: commit be1d325 ("IB/core: Set RoCEv2 MGID according to spec")
Signed-off-by: Bart Van Assche <[email protected]>
Reviewed-by: Leon Romanovsky <[email protected]>
Signed-off-by: Doug Ledford <[email protected]>
  • Loading branch information
KAGA-KOKO authored and dledford committed Oct 15, 2017
1 parent 166245d commit 1c3aea2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/rdma/ib_addr.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,12 @@ static inline void rdma_get_ll_mac(struct in6_addr *addr, u8 *mac)

static inline int rdma_is_multicast_addr(struct in6_addr *addr)
{
u32 ipv4_addr;
__be32 ipv4_addr;

if (addr->s6_addr[0] == 0xff)
return 1;

memcpy(&ipv4_addr, addr->s6_addr + 12, 4);
ipv4_addr = addr->s6_addr32[3];
return (ipv6_addr_v4mapped(addr) && ipv4_is_multicast(ipv4_addr));
}

Expand Down

0 comments on commit 1c3aea2

Please sign in to comment.