summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2009-06-25 07:27:25 -0400
committerJeff Layton <jlayton@redhat.com>2009-06-25 07:27:25 -0400
commit2032a1914d72e4de89280e179c782566cafc163a (patch)
tree49e27cc5c6523d7ad63a182746a8d3177563386c /client
parent313a2bfa527796f6512b2589a8b567c86436cf12 (diff)
downloadsamba-2032a1914d72e4de89280e179c782566cafc163a.tar.gz
samba-2032a1914d72e4de89280e179c782566cafc163a.tar.bz2
samba-2032a1914d72e4de89280e179c782566cafc163a.zip
mount.cifs: add support for sending IPv6 scope ID to kernel
When getaddrinfo returns an IPv6 address with a non-zero scope_id, send that to the kernel appended to the address with a '%' delimiter. This allows people to mount servers via their link-local IPv6 addresses (given a kernel that understands this address format, of course). Signed-off-by: Jeff Layton <jlayton@redhat.com>
Diffstat (limited to 'client')
-rw-r--r--client/mount.cifs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/client/mount.cifs.c b/client/mount.cifs.c
index 97144a0607..db05665f96 100644
--- a/client/mount.cifs.c
+++ b/client/mount.cifs.c
@@ -1562,6 +1562,14 @@ mount_retry:
}
}
+ if (addr->ai_addr->sa_family == AF_INET6 && addr6->sin6_scope_id) {
+ strlcat(options, "%", options_size);
+ current_len = strnlen(options, options_size);
+ optionstail = options + current_len;
+ snprintf(optionstail, options_size - current_len, "%u",
+ addr6->sin6_scope_id);
+ }
+
if (!fakemnt && mount(dev_name, mountpoint, "cifs", flags, options)) {
switch (errno) {
case ECONNREFUSED: