summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-06-19 12:34:59 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:18:31 -0500
commit683f3bc96ee8b388d547a64734b8c0bf356e85f1 (patch)
tree9bb6e5ebc9ca8f1a489ecd43dddd23505e98f370 /source4
parentb3e862b2d586712635f7409100ebb7885d6836d1 (diff)
downloadsamba-683f3bc96ee8b388d547a64734b8c0bf356e85f1.tar.gz
samba-683f3bc96ee8b388d547a64734b8c0bf356e85f1.tar.bz2
samba-683f3bc96ee8b388d547a64734b8c0bf356e85f1.zip
r7754: fixed the local port of accepted sockets in socket_wrapper. This fixes
the problem with the ldap tests in 'make test' (This used to be commit 56fe27623ce31015a5a14f176f1445f51d57b0b8)
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/socket_wrapper/socket_wrapper.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/source4/lib/socket_wrapper/socket_wrapper.c b/source4/lib/socket_wrapper/socket_wrapper.c
index 882ef462ea..42bac4bfae 100644
--- a/source4/lib/socket_wrapper/socket_wrapper.c
+++ b/source4/lib/socket_wrapper/socket_wrapper.c
@@ -242,11 +242,10 @@ int swrap_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
memset(child_si, 0, sizeof(*child_si));
child_si->fd = fd;
+ child_si->bound = 1;
- if (addr && addrlen) {
- child_si->myname_len = *addrlen;
- child_si->myname = sockaddr_dup(addr, *addrlen);
- }
+ child_si->myname_len = parent_si->myname_len;
+ child_si->myname = sockaddr_dup(parent_si->myname, parent_si->myname_len);
child_si->peername_len = *addrlen;
child_si->peername = sockaddr_dup(addr, *addrlen);