[openib-general] [PATCH] ib_cm: fix REJ due to invalid GID

Sean Hefty sean.hefty at intel.com
Tue Jul 18 15:09:21 PDT 2006


The following patch should set the reject code properly when
rejecting a request that contains an invalid GID.  A suitable
GID is returned by the IB CM in the additional reject information
(ARI).

Signed-off-by: Sean Hefty <sean.hefty at intel.com>
---
Index: cm.c
===================================================================
--- cm.c	(revision 8484)
+++ cm.c	(working copy)
@@ -1372,12 +1372,23 @@ static int cm_req_handler(struct cm_work
 
 	cm_format_paths_from_req(req_msg, &work->path[0], &work->path[1]);
 	ret = cm_init_av_by_path(&work->path[0], &cm_id_priv->av);
-	if (ret)
+	if (ret) {
+		ib_get_cached_gid(work->port->cm_dev->device,
+				  work->port->port_num, 0, &work->path[0].sgid);
+		cm_issue_rej(work->port, work->mad_recv_wc,
+			     IB_CM_REJ_INVALID_GID, CM_MSG_RESPONSE_REQ,
+			     &work->path[0].sgid, sizeof work->path[0].sgid);
 		goto error3;
+	}
 	if (req_msg->alt_local_lid) {
 		ret = cm_init_av_by_path(&work->path[1], &cm_id_priv->alt_av);
-		if (ret)
+		if (ret) {
+			cm_issue_rej(work->port, work->mad_recv_wc,
+				     IB_CM_REJ_INVALID_ALT_GID,
+				     CM_MSG_RESPONSE_REQ, &work->path[0].sgid,
+				     sizeof work->path[0].sgid);
 			goto error3;
+		}
 	}
 	cm_id_priv->tid = req_msg->hdr.tid;
 	cm_id_priv->timeout_ms = cm_convert_to_ms(





More information about the general mailing list