From 683f3bc96ee8b388d547a64734b8c0bf356e85f1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 19 Jun 2005 12:34:59 +0000 Subject: 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) --- source4/lib/socket_wrapper/socket_wrapper.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source4/lib') 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); -- cgit