]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
RDMA/core: Resolve MAC of next-hop device without ARP support
authorParav Pandit <parav@nvidia.com>
Tue, 16 Sep 2025 11:11:01 +0000 (14:11 +0300)
committerLeon Romanovsky <leon@kernel.org>
Thu, 18 Sep 2025 09:20:20 +0000 (05:20 -0400)
Currently, if the next-hop netdevice does not support ARP resolution,
the destination MAC address is silently set to zero without reporting
an error. This leads to incorrect behavior and may result in packet
transmission failures.

Fix this by deferring MAC resolution to the IP stack via neighbour
lookup, allowing proper resolution or error reporting as appropriate.

Fixes: 7025fcd36bd6 ("IB: address translation to map IP toIB addresses (GIDs)")
Signed-off-by: Parav Pandit <parav@nvidia.com>
Reviewed-by: Vlad Dumitrescu <vdumitrescu@nvidia.com>
Signed-off-by: Edward Srouji <edwards@nvidia.com>
Link: https://patch.msgid.link/20250916111103.84069-3-edwards@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/core/addr.c

index 594e7ee335f7d3515db23a6fa0ac3531f9b4a16e..ca86c482662fb874d237bc8e4f162cb2e1711cfe 100644 (file)
@@ -454,14 +454,10 @@ static int addr_resolve_neigh(const struct dst_entry *dst,
 {
        int ret = 0;
 
-       if (ndev_flags & IFF_LOOPBACK) {
+       if (ndev_flags & IFF_LOOPBACK)
                memcpy(addr->dst_dev_addr, addr->src_dev_addr, MAX_ADDR_LEN);
-       } else {
-               if (!(ndev_flags & IFF_NOARP)) {
-                       /* If the device doesn't do ARP internally */
-                       ret = fetch_ha(dst, addr, dst_in, seq);
-               }
-       }
+       else
+               ret = fetch_ha(dst, addr, dst_in, seq);
        return ret;
 }