On Mon, May 14, 2018 at 01:38:15PM +0100, Simon McVittie wrote: > On Sat, 12 May 2018 at 18:26:11 -0700, Ross Vandegrift wrote: > > It looks like the scope id was added in #644912. This may be a kernel bug > > if > > the scope id should be accepted. > > I think this might be a bug in whatever user-space tool calls > getaddrinfo() and passes its result to the kernel, which probably means > mount.nfs? If the kernel doesn't want to see scope IDs in this context, > then the user-space tool shouldn't provide them: returning scope IDs is > part of the getaddrinfo() API.
I did some digging, here's what I found. mount.nfs accepts scoped ipv6 addresses: $ sudo mount.nfs -vf '[fd7d:612b:f36c:0:4d15:7364:6589:dbef%2]:/' /mnt/tmp -o nfsvers=4.2 mount.nfs: timeout set for Mon May 14 19:11:01 2018 mount.nfs: trying text-based options 'vers=4.2,addr=fd7d:612b:f36c:0:4d15:7364:6589:dbef%2,clientaddr=fd7d:612b:f36c::4c5' But mount(2) fails: $ sudo mount.nfs -v '[fd7d:612b:f36c:0:4d15:7364:6589:dbef%2]:/' /mnt/tmp -o nfsvers=4.2 mount.nfs: timeout set for Mon May 14 19:12:48 2018 mount.nfs: trying text-based options 'nfsvers=4.2,addr=fd7d:612b:f36c:0:4d15:7364:6589:dbef%2,clientaddr=fd7d:612b:f36c::4c5' mount.nfs: mount(2): Invalid argument mount.nfs: an incorrect mount option was specified nfs(5) has the following to say about the source argument: The server's hostname can be an unqualified hostname, a fully qualified domain name, a dotted quad IPv4 address, or an IPv6 address enclosed in square brackets. Link-local and site-local IPv6 addresses must be accompanied by an interface identifier. See ipv6(7) for details on specifying raw IPv6 addresses. And ipv6(7) has this to say about the scope id field: sin6_scope_id is an ID depending on the scope of the address. It is new in Linux 2.4. Linux supports it only for link-local addresses, in that case sin6_scope_id contains the interface index (see netdevice(7)) Best as I can figure there's three wishlist bugs here: 1. nss-mdns should not return scope id for global addresses 2. mount.nfs should strip scope id unless the address is link-local 3. the kernel should accept & ignore scope id on non-global addresses Does this seems like a reasonable reading? Ross