Commit 1c9b2819 authored by Jason Gunthorpe's avatar Jason Gunthorpe Committed by Roland Dreier

RDMA/cma: Correct detection of SA Created MGID

RDMA CM treats AF_INET6 addresses that are either 0 or prefixed with
FF1x:A01B::/32 as MGIDs, but the detection for the prefix was buggy;
fix it up.
Signed-off-by: default avatarJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: default avatarSean Hefty <sean.hefty@intel.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 0f9ea5d2
...@@ -2687,7 +2687,7 @@ static void cma_set_mgid(struct rdma_id_private *id_priv, ...@@ -2687,7 +2687,7 @@ static void cma_set_mgid(struct rdma_id_private *id_priv,
if (cma_any_addr(addr)) { if (cma_any_addr(addr)) {
memset(mgid, 0, sizeof *mgid); memset(mgid, 0, sizeof *mgid);
} else if ((addr->sa_family == AF_INET6) && } else if ((addr->sa_family == AF_INET6) &&
((be32_to_cpu(sin6->sin6_addr.s6_addr32[0]) & 0xFF10A01B) == ((be32_to_cpu(sin6->sin6_addr.s6_addr32[0]) & 0xFFF0FFFF) ==
0xFF10A01B)) { 0xFF10A01B)) {
/* IPv6 address is an SA assigned MGID. */ /* IPv6 address is an SA assigned MGID. */
memcpy(mgid, &sin6->sin6_addr, sizeof *mgid); memcpy(mgid, &sin6->sin6_addr, sizeof *mgid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment