[ofa-general] [PATCH] dapl-scm: getsockopt optlen needs initialized to size of optval

Davis, Arlin R arlin.r.davis at intel.com
Sun Apr 19 00:55:51 PDT 2009


>From 55459699fa9c0e5fb7e2b17822f0916412c64b35 Mon Sep 17 00:00:00 2001
From: Arlin Davis <arlin.r.davis at intel.com>
Date: Fri, 10 Apr 2009 08:31:22 -0700
 

Signed-off-by: Arlin Davis <ardavis at ichips.intel.com>
---
 dapl/openib_scm/dapl_ib_cm.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/dapl/openib_scm/dapl_ib_cm.c b/dapl/openib_scm/dapl_ib_cm.c
index 6028a45..a11cd05 100644
--- a/dapl/openib_scm/dapl_ib_cm.c
+++ b/dapl/openib_scm/dapl_ib_cm.c
@@ -1642,6 +1642,7 @@ void cr_thread(void *arg)
 			} else if (ret == DAPL_FD_WRITE || ret == DAPL_FD_ERROR) {
 				if (cr->state == SCM_CONN_PENDING) {
 					opt = 0;
+					opt_len = sizeof(opt);
 					ret = getsockopt(cr->socket, SOL_SOCKET,
 						SO_ERROR, (char *) &opt, &opt_len);
 					if (!ret)
-- 
1.5.2.5




More information about the general mailing list