dapl_log(DAPL_DBG_TYPE_CM,
" MCM connect: lid %x QPr %x QPt %x lport %x p_sz=%d -> "
" lid %x c_qpn %x rport %x ep_map %d %s -> %d %s, retries=%d\n",
- htons(cm->msg.saddr1.lid), htonl(cm->msg.saddr1.qpn),
+ htons(cm->tp->addr.lid), htonl(cm->msg.saddr1.qpn),
htonl(cm->msg.saddr2.qpn),
htons(cm->msg.sport), htons(cm->msg.p_size),
htons(cm->msg.daddr1.lid), htonl(cm->msg.dqpn),
htons(cm->msg.dport),
- cm->msg.saddr1.ep_map, mcm_map_str(cm->msg.saddr1.ep_map),
+ cm->tp->addr.ep_map, mcm_map_str(cm->tp->addr.ep_map),
cm->msg.daddr1.ep_map, mcm_map_str(cm->msg.daddr1.ep_map),
cm->tp->retries);
dapl_log(DAPL_DBG_TYPE_CM, " MCM connect -> AF %d LID 0x%x QPN 0x%x GID"
" 0x" F64x ":" F64x " port %d ep_map %s sl %d qt %d\n",
- mcm_ia->family, ntohl(mcm_ia->qpn), ntohs(mcm_ia->lid),
+ mcm_ia->family, ntohs(mcm_ia->lid), ntohl(mcm_ia->qpn),
(unsigned long long)ntohll(*(uint64_t*)&mcm_ia->gid[0]),
(unsigned long long)ntohll(*(uint64_t*)&mcm_ia->gid[8]),
mcm_ia->port, mcm_map_str(mcm_ia->ep_map),
/* remote hca and port: lid, gid, network order */
dapl_os_memcpy(&cm->msg.daddr1, r_addr, sizeof(struct dat_mcm_addr));
+ /* validate port and ep_map range */
+ if ((mcm_ia->port > 2) || (mcm_ia->ep_map > 3))
+ cm->msg.daddr1.ep_map = 0;
+
/* remote uCM information, comes from consumer provider r_addr */
cm->msg.dport = htons((uint16_t)r_psp);
cm->msg.dqpn = cm->msg.daddr1.qpn;
dapl_log(DAPL_DBG_TYPE_CM, " UCM connect -> AF %d LID 0x%x QPN 0x%x GID"
" 0x" F64x ":" F64x " port %d sl %d qt %d\n",
- ucm_ia->ib.family, ntohl(ucm_ia->ib.qpn), ntohs(ucm_ia->ib.lid),
+ ucm_ia->ib.family, ntohs(ucm_ia->ib.lid), ntohl(ucm_ia->ib.qpn),
(unsigned long long)ntohll(*(uint64_t*)&ucm_ia->ib.gid[0]),
(unsigned long long)ntohll(*(uint64_t*)&ucm_ia->ib.gid[8]),
ntohs(ucm_ia->ib.port), ucm_ia->ib.sl, ucm_ia->ib.qp_type);