James Lentini wrote:
static void cma_format_hdr(void *hdr, enum rdma_port_space ps,
                           struct rdma_route *route)
{
@@ -1371,6 +1379,9 @@ static void cma_format_hdr(void *hdr, en
        src4 = (struct sockaddr_in *) &route->addr.src_addr;
        dst4 = (struct sockaddr_in *) &route->addr.dst_addr;
+       if (!src4->sin_port)
+               src4->sin_port = cma_generate_ephemeral_port();

This only sets the port number in the header. It would make more sense to save the port number in the rdma_cm_id's src_addr.


I thought I was saving the port number in the rdma_cm_id's src_addr. src4 is an alias of the rdma_id_private's rdma_cma_id's rdma_route's rdma_addr's src_addr field.
How would you do it differently?

I missed that this was setting this through an alias. In that case, it makes more sense to move saving this information to another function. Setting this inside 'cma_format_hdr()' seems like a unintended side effect.

- Sean


_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to