Subject: Re: IPv6: presentation format for zero scope ID

From: Brian Haley <[email-masked]>
Date: Mon, 07 Dec 2009 22:27:16 -0500

Chuck Lever wrote:
> I recently added some functions to sunrpc.ko that behave like
> getnameinfo(AI_NUMERICHOST) does in user space.
> 
> One of the functions, rpc_ntop6(), sticks a scope ID on the end of link-
> and site-local IPv6 addresses.  It does not try to map the scope ID to a
> device name.

Site-local addresses have been deprecated...

> It has been pointed out, however, that glibc's getnameinfo(3) skips
> appending a device name if the scope ID is zero.  Should rpc_ntop6()
> display or ignore zero scope IDs?

A zero scope id implies it's not set, so I would ignore it.  Things like
*bind() and *connect() already do this.

> Would it be better if it also
> converted scope IDs to device names?

*nix typically uses %eth0, Windows uses %1, so I guess if it's for
display purposes I'd do the same thing all the tools use - %name.
This isn't being put in a packet, is it?

> I'm not familiar enough with the IETF mandates regarding presentation
> address format, or the idiosyncrasies of the Linux IPv6 implementation,
> to know what is the desired behavior here.  Any guidance appreciated.

The URI spec (RFC 3986) doesn't cover scope id's, so it winds-up being
implementor's choice.

-Brian