[PATCH] mount.cifs: add support for sending IPv6 scope ID to kernel

View: New views
2 Messages — Rating Filter:   Alert me  

[PATCH] mount.cifs: add support for sending IPv6 scope ID to kernel

by Jeff Layton-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...>
---
 client/mount.cifs.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/client/mount.cifs.c b/client/mount.cifs.c
index 97144a0..db05665 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:
--
1.6.0.6

_______________________________________________
linux-cifs-client mailing list
linux-cifs-client@...
https://lists.samba.org/mailman/listinfo/linux-cifs-client

Re: [PATCH] mount.cifs: add support for sending IPv6 scope ID to kernel

by Jeff Layton-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 11 Jun 2009 12:48:52 -0400
Jeff Layton <jlayton@...> wrote:

> 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@...>


Committed to samba master branch.
_______________________________________________
linux-cifs-client mailing list
linux-cifs-client@...
https://lists.samba.org/mailman/listinfo/linux-cifs-client