if (id_priv == cur_id)
continue;
------ if ((cur_id->state == RDMA_CM_LISTEN) ||
------ !reuseaddr || !cur_id->reuseaddr) {
------ cur_addr = (struct sockaddr *) &cur_id->id.route.addr.src_addr;
------ if (cma_any_addr(cur_addr))
------ return -EADDRNOTAVAIL;
++++++ if ((cur_id->state != RDMA_CM_LISTEN) && reuseaddr &&
++++++ cur_id->reuseaddr)
++++++ continue;
+
- ---- if (!cma_addr_cmp(addr, cur_addr))
- ---- return -EADDRINUSE;
- ---- }
++++++ cur_addr = (struct sockaddr *) &cur_id->id.route.addr.src_addr;
++++++ if (id_priv->afonly && cur_id->afonly &&
++++++ (addr->sa_family != cur_addr->sa_family))
++++++ continue;
++++++
++++++ if (cma_any_addr(addr) || cma_any_addr(cur_addr))
++++++ return -EADDRNOTAVAIL;
+ ++++
- if (!cma_addr_cmp(addr, cur_addr))
- return -EADDRINUSE;
- }
++++++ if (!cma_addr_cmp(addr, cur_addr))
++++++ return -EADDRINUSE;
}
return 0;
}