Re: [PATCH rdma-next] RDMA/core: Fix broadcast address falsely detected as local
From: Jason Gunthorpe
Date: Wed Jun 10 2026 - 14:05:06 EST
On Tue, Jun 09, 2026 at 02:16:38PM +0300, Edward Srouji wrote:
> From: Maher Sanalla <msanalla@xxxxxxxxxx>
>
> When rdma_resolve_addr() is invoked with a broadcast destination on an
> IPoIB interface, is_dst_local() inspects the resolved route and
> incorrectly concludes that the address is local. As a result, the
> resolution fails with -ENODEV.
> The issue stems from using '&' to compare rt_type with RTN_LOCAL. The
> RTN_* values form a sequential enum, not a bitmask (RTN_LOCAL=2,
> RTN_BROADCAST=3). Thus, "rt_type & RTN_LOCAL" yields a non-zero result
> for a broadcast route as well.
>
> Replace '&' with '==' when comparing rt_type against RTN_LOCAL.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: c31e4038c97f ("RDMA/core: Use route entry flag to decide on loopback traffic")
> Signed-off-by: Maher Sanalla <msanalla@xxxxxxxxxx>
> Reviewed-by: Vlad Dumitrescu <vdumitrescu@xxxxxxxxxx>
> Signed-off-by: Edward Srouji <edwards@xxxxxxxxxx>
> Reviewed-by: Parav Pandit <parav@xxxxxxxxxx>
> ---
> drivers/infiniband/core/addr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to for-next
Thanks,
Jason