summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-02-17 08:45:58 +0100
committerStefan Metzmacher <metze@samba.org>2010-02-17 14:45:34 +0100
commit6637b2f4b06fcee1e8e1b1782dd96e3273f8caac (patch)
treee7e317e5cb575bc68eb5553b1823e7313f7cddf6
parent135543b4c300e2fc31ee4165ce630644e1aef455 (diff)
downloadsamba-6637b2f4b06fcee1e8e1b1782dd96e3273f8caac.tar.gz
samba-6637b2f4b06fcee1e8e1b1782dd96e3273f8caac.tar.bz2
samba-6637b2f4b06fcee1e8e1b1782dd96e3273f8caac.zip
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
-rw-r--r--lib/tsocket/tsocket_bsd.c2
1 files changed, 1 insertions, 1 deletions
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;