From 6637b2f4b06fcee1e8e1b1782dd96e3273f8caac Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 17 Feb 2010 08:45:58 +0100 Subject: tsocket/bsd: fix bug #7140 use calculated sa_socklen for bind() in tstream_bsd_connect_send() This is needed because, we can't use sizeof(sockaddr_storage) for AF_UNIX sockets. Also some platforms require exact values for AF_INET and AF_INET6. metze --- lib/tsocket/tsocket_bsd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/tsocket/tsocket_bsd.c b/lib/tsocket/tsocket_bsd.c index 5cd7702ff6..8d1fe32083 100644 --- a/lib/tsocket/tsocket_bsd.c +++ b/lib/tsocket/tsocket_bsd.c @@ -2025,7 +2025,7 @@ static struct tevent_req * tstream_bsd_connect_send(TALLOC_CTX *mem_ctx, } if (do_bind) { - ret = bind(state->fd, &lbsda->u.sa, sizeof(lbsda->u.ss)); + ret = bind(state->fd, &lbsda->u.sa, sa_socklen); if (ret == -1) { tevent_req_error(req, errno); goto post; -- cgit