[PATCH] s3: Fix connecting to port-139 only servers

Volker Lendecke vl at samba.org
Sat Jan 22 08:22:42 MST 2011


When the TCP RST came before the 5 msecs timeout kicked in, we
viewed this as final, as state->req_139 was not set yet.
---
 source3/libsmb/smbsock_connect.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/source3/libsmb/smbsock_connect.c b/source3/libsmb/smbsock_connect.c
index 174d2aa..352de85 100644
--- a/source3/libsmb/smbsock_connect.c
+++ b/source3/libsmb/smbsock_connect.c
@@ -253,12 +253,14 @@ struct tevent_req *smbsock_connect_send(TALLOC_CTX *mem_ctx,
 	/*
 	 * After 5 msecs, fire the 139 request
 	 */
-	subreq = tevent_wakeup_send(state, ev, timeval_current_ofs(0, 5000));
-	if (tevent_req_nomem(subreq, req)) {
+	state->req_139 = tevent_wakeup_send(
+		state, ev, timeval_current_ofs(0, 5000));
+	if (tevent_req_nomem(state->req_139, req)) {
 		TALLOC_FREE(state->req_445);
 		return tevent_req_post(req, ev);
 	}
-	tevent_req_set_callback(subreq, smbsock_connect_do_139, req);
+	tevent_req_set_callback(state->req_139, smbsock_connect_do_139,
+				req);
 	return req;
 }
 
-- 
1.7.3.2


--zYM0uCDKw75PZbzx--


More information about the samba-technical mailing list