diff options
author | Stefan Metzmacher <metze@samba.org> | 2009-03-20 16:27:17 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2009-03-21 10:44:40 +0100 |
commit | 66dc53ee017d74a6f610bbe04337f064901fe2a1 (patch) | |
tree | 2d6af6614a2b4b9e168e1f74187c155c3c219245 | |
parent | 62ab39dde37f5570b336b9db5b4e3c2e4640e877 (diff) | |
download | samba-66dc53ee017d74a6f610bbe04337f064901fe2a1.tar.gz samba-66dc53ee017d74a6f610bbe04337f064901fe2a1.tar.bz2 samba-66dc53ee017d74a6f610bbe04337f064901fe2a1.zip |
socket_wrapper: fix connect() for dgram sockets, if the destination isn't there yet
metze
-rw-r--r-- | lib/socket_wrapper/socket_wrapper.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/socket_wrapper/socket_wrapper.c b/lib/socket_wrapper/socket_wrapper.c index 44082e78a1..1d35c8d20c 100644 --- a/lib/socket_wrapper/socket_wrapper.c +++ b/lib/socket_wrapper/socket_wrapper.c @@ -1686,10 +1686,14 @@ _PUBLIC_ int swrap_connect(int s, const struct sockaddr *serv_addr, socklen_t ad ret = sockaddr_convert_to_un(si, (const struct sockaddr *)serv_addr, addrlen, &un_addr, 0, NULL); if (ret == -1) return -1; - swrap_dump_packet(si, serv_addr, SWRAP_CONNECT_SEND, NULL, 0); + if (si->type == SOCK_DGRAM) { + ret = 0; + } else { + swrap_dump_packet(si, serv_addr, SWRAP_CONNECT_SEND, NULL, 0); - ret = real_connect(s, (struct sockaddr *)&un_addr, - sizeof(struct sockaddr_un)); + ret = real_connect(s, (struct sockaddr *)&un_addr, + sizeof(struct sockaddr_un)); + } /* to give better errors */ if (ret == -1 && errno == ENOENT) { |