From: Chien Tung Date: Sat, 22 Nov 2008 02:51:04 +0000 (-0600) Subject: RDMA/nes: Add loopback check to make_cm_node() X-Git-Tag: MMI-PSA29.97-13-9~30476^2^6~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1ee86555b2ad4d16a3c18253b7e4d70d34eb94f3;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git RDMA/nes: Add loopback check to make_cm_node() Check for loopback connection in make_cm_node(). Signed-off-by: Chien Tung Signed-off-by: Roland Dreier --- diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c index 0997c7b8cd9b..f241ca104d16 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c @@ -1142,7 +1142,10 @@ static struct nes_cm_node *make_cm_node(struct nes_cm_core *cm_core, cm_node->loopbackpartner = NULL; /* get the mac addr for the remote node */ - arpindex = nes_arp_table(nesdev, cm_node->rem_addr, NULL, NES_ARP_RESOLVE); + if (ipv4_is_loopback(htonl(cm_node->rem_addr))) + arpindex = nes_arp_table(nesdev, ntohl(nesvnic->local_ipaddr), NULL, NES_ARP_RESOLVE); + else + arpindex = nes_arp_table(nesdev, cm_node->rem_addr, NULL, NES_ARP_RESOLVE); if (arpindex < 0) { arpindex = nes_addr_resolve_neigh(nesvnic, cm_info->rem_addr); if (arpindex < 0) {