mount.cifs: add support for sending IPv6 scope ID to kernel
[metze/samba/wip.git] / client / mount.cifs.c
index 97144a060727af804e6fad026d3b95d504373e96..db05665f96cc02607aa6cdf2208db5712d7e26e4 100644 (file)
@@ -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: