summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-03-03 19:40:57 +0100
committerStefan Metzmacher <metze@samba.org>2009-03-08 15:18:05 +0100
commit81e2633e41e9c8c1dddff7cc1122c7d6f28626bd (patch)
treefe28d7b0dfd3776e7623cfd286c4fba6fcd23b7d /lib
parentdea9621680062b3726ad15cbec4a9d2cf7ce824e (diff)
downloadsamba-81e2633e41e9c8c1dddff7cc1122c7d6f28626bd.tar.gz
samba-81e2633e41e9c8c1dddff7cc1122c7d6f28626bd.tar.bz2
samba-81e2633e41e9c8c1dddff7cc1122c7d6f28626bd.zip
socket_wrapper: make it possible to bind to '::'
metze
Diffstat (limited to 'lib')
-rw-r--r--lib/socket_wrapper/socket_wrapper.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/socket_wrapper/socket_wrapper.c b/lib/socket_wrapper/socket_wrapper.c
index 8ad9e1d93e..1f56a8358e 100644
--- a/lib/socket_wrapper/socket_wrapper.c
+++ b/lib/socket_wrapper/socket_wrapper.c
@@ -510,7 +510,9 @@ static int convert_in_un_alloc(struct socket_info *si, const struct sockaddr *in
cmp = in->sin6_addr;
cmp.s6_addr[15] = 0;
- if (IN6_ARE_ADDR_EQUAL(&swrap_ipv6, &cmp)) {
+ if (IN6_IS_ADDR_UNSPECIFIED(&in->sin6_addr)) {
+ iface = socket_wrapper_default_iface();
+ } else if (IN6_ARE_ADDR_EQUAL(&swrap_ipv6, &cmp)) {
iface = in->sin6_addr.s6_addr[15];
} else {
errno = EADDRNOTAVAIL;