mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
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>
This commit is contained in:
parent
313a2bfa52
commit
2032a1914d
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user