From: Sean Hefty Date: Thu, 10 Feb 2011 20:06:46 +0000 (-0800) Subject: Set SM LID address in network byte order X-Git-Tag: v1.0.5~13 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=69568d2aafa655c848afc8e6e7901a2fe8a428ab;p=~shefty%2Fibacm.git Set SM LID address in network byte order acm_set_dest_addr expects LIDs to be in network order. Convert the sm_lid retrieved from the port attributes into network order. This formats the LID value correctly when entered into the ibacm log. Signed-off-by: Sean Hefty --- diff --git a/src/acm.c b/src/acm.c index 10680f8..d52e83a 100644 --- a/src/acm.c +++ b/src/acm.c @@ -2637,13 +2637,14 @@ static void acm_port_up(struct acm_port *port) port->lid = attr.lid; port->lid_mask = 0xffff - ((1 << attr.lmc) - 1); - acm_set_dest_addr(&port->sa_dest, ACM_ADDRESS_LID, - (uint8_t *) &attr.sm_lid, sizeof(attr.sm_lid)); port->sa_dest.av.src_path_bits = 0; port->sa_dest.av.dlid = attr.sm_lid; port->sa_dest.av.sl = attr.sm_sl; port->sa_dest.av.port_num = port->port_num; port->sa_dest.remote_qpn = 1; + attr.sm_lid = htons(attr.sm_lid); + acm_set_dest_addr(&port->sa_dest, ACM_ADDRESS_LID, + (uint8_t *) &attr.sm_lid, sizeof(attr.sm_lid)); port->sa_dest.ah = ibv_create_ah(port->dev->pd, &port->sa_dest.av); if (!port->sa_dest.ah)