summaryrefslogtreecommitdiffstats
path: root/source3/lib/util_sock.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-10-25 18:28:36 -0700
committerJeremy Allison <jra@samba.org>2007-10-25 18:28:36 -0700
commit6128d116b3f09ce0b055d2df89b2f7282185782e (patch)
tree4ad151c7224422b1c8f4e1cdca1ffba3d29391f0 /source3/lib/util_sock.c
parent922db252728b6a9cf72f463a7ce9d5c13f04f5f8 (diff)
downloadsamba-6128d116b3f09ce0b055d2df89b2f7282185782e.tar.gz
samba-6128d116b3f09ce0b055d2df89b2f7282185782e.tar.xz
samba-6128d116b3f09ce0b055d2df89b2f7282185782e.zip
Fix resolve name to resolve IPv6 addresses of link-local%ifaddr
Jeremy. (This used to be commit e6609cab732d5cd5cc9a5ae50aee15147f2ec6ec)
Diffstat (limited to 'source3/lib/util_sock.c')
-rw-r--r--source3/lib/util_sock.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 8a85f7a5c55..c30f21eeb7f 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -64,7 +64,7 @@ bool is_ipaddress(const char *str)
}
/****************************************************************************
- Is a sockaddr_storage a broadcast address ?
+ Is a sockaddr_storage a broadcast address ?
****************************************************************************/
bool is_broadcast_addr(const struct sockaddr_storage *pss)
@@ -1478,6 +1478,10 @@ int open_socket_out(int type,
if (pss->ss_family == AF_INET6) {
struct sockaddr_in6 *psa6 = (struct sockaddr_in6 *)&sock_out;
psa6->sin6_port = htons(port);
+ if (psa6->sin6_scope_id == 0 &&
+ IN6_IS_ADDR_LINKLOCAL(&psa6->sin6_addr)) {
+ setup_linklocal_scope_id(&sock_out);
+ }
}
#endif
if (pss->ss_family == AF_INET) {