summaryrefslogtreecommitdiff
path: root/source4/lib/socket
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-06-06 11:31:23 +1000
committerAndrew Tridgell <tridge@samba.org>2011-06-06 05:35:36 +0200
commitd168a5e703288a5fba3f35a6e44d3f5d5733e6c5 (patch)
tree9ac146d2424523236dd069a3083264cb50d2eeb1 /source4/lib/socket
parent66aec3cf67595c7aec5d10775892dad2538caf65 (diff)
downloadsamba-d168a5e703288a5fba3f35a6e44d3f5d5733e6c5.tar.gz
samba-d168a5e703288a5fba3f35a6e44d3f5d5733e6c5.tar.bz2
samba-d168a5e703288a5fba3f35a6e44d3f5d5733e6c5.zip
s4-ipv6: fill in family when initialising from sockaddr
Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Mon Jun 6 05:35:36 CEST 2011 on sn-devel-104
Diffstat (limited to 'source4/lib/socket')
-rw-r--r--source4/lib/socket/socket.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source4/lib/socket/socket.c b/source4/lib/socket/socket.c
index 369cf5ff36..b16e38c372 100644
--- a/source4/lib/socket/socket.c
+++ b/source4/lib/socket/socket.c
@@ -503,7 +503,19 @@ _PUBLIC_ struct socket_address *socket_address_from_sockaddr(TALLOC_CTX *mem_ctx
if (!addr) {
return NULL;
}
- addr->family = NULL;
+ switch (sockaddr->sa_family) {
+ case AF_INET:
+ addr->family = "ipv4";
+ break;
+#ifdef HAVE_IPV6
+ case AF_INET6:
+ addr->family = "ipv6";
+ break;
+#endif
+ case AF_UNIX:
+ addr->family = "unix";
+ break;
+ }
addr->addr = NULL;
addr->port = 0;
addr->sockaddr = (struct sockaddr *)talloc_memdup(addr, sockaddr, sockaddrlen);