Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

RDMA/core: Fix logic error in ib_get_gids_from_rdma_hdr()

Fix missing comparison operator for RDMA_NETWORK_ROCE_V1 in the
conditional statement. The constant was used directly instead of
being compared with net_type, causing the condition to always
evaluate to true.

Fixes: 1c15b4f2a42f ("RDMA/core: Modify enum ib_gid_type and enum rdma_network_type")
Signed-off-by: Jang Ingyu <ingyujang25@korea.ac.kr>
Link: https://patch.msgid.link/20251219041508.1725947-1-ingyujang25@korea.ac.kr
Signed-off-by: Leon Romanovsky <leon@kernel.org>

authored by

Jang Ingyu and committed by
Leon Romanovsky
8aaa848e 85463eb6

+1 -1
+1 -1
drivers/infiniband/core/verbs.c
··· 738 738 (struct in6_addr *)dgid); 739 739 return 0; 740 740 } else if (net_type == RDMA_NETWORK_IPV6 || 741 - net_type == RDMA_NETWORK_IB || RDMA_NETWORK_ROCE_V1) { 741 + net_type == RDMA_NETWORK_IB || net_type == RDMA_NETWORK_ROCE_V1) { 742 742 *dgid = hdr->ibgrh.dgid; 743 743 *sgid = hdr->ibgrh.sgid; 744 744 return 0;