Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Jan 2012 18:01:00 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        freebsd-hackers@freebsd.org
Subject:   Re: [ANN] host-setup 4.0 released
Message-ID:  <4F03425C.6040104@infracaninophile.co.uk>
In-Reply-To: <2092634439.782373.1325609539518.JavaMail.root@erie.cs.uoguelph.ca>
References:  <2092634439.782373.1325609539518.JavaMail.root@erie.cs.uoguelph.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig7948054E1E4628BD4CCF03D2
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 03/01/2012 16:52, Rick Macklem wrote:
> The basics are in RFC4291, but I think that inet_pton(3) knows how to
> deal with it. (I think "::" can be used once to specify the longest #
> of 16bit fields that are all zeros.)

RFC 4291 has a basic description of the textual representation of IPv6
addresses, but it is ambiguous: there are several different ways to
present the same address according to the RFC 4291 rules.

inet_pton(3) follows RFC 5952 which is a superset of the 4291 rules,
only allowing a single, unambiguous representation for each IPv6 number.

> After inet_pton() has translated it to a binary address, then the macro=
s
> in sys/netinet6/in6.h can be used to determine if the address is a loop=
back, etc.

While 5952 describes how to correctly present an IPv6 address, there's
still lots of important other stuff in 4291.  For instance bit 70 in an
IPv6 address flags that the address is derived from a number hardwired
into the interface -- typically the ethernet MAC address, as is commonly
done for SLAAC (StateLess Address Autoconfiguration: RFC 4862,
rtsold(8), rtadvd(8)). So an arbitrarily invented address should have
that bit set to zero.  Bit 71 is also special, indicating manycast vs
unicast, and should also be zero for the vast majority of uses.
See
http://www.infracaninophile.co.uk/articles/hotchpotch.html#rand-aaaa.pl
for some perl code that operates in this area.

Also of interest: RFC 5156 which lists IPv6 address ranges dedicated to
special purpose usages, and RFC 4193 which roughly is the IPv6
equivalent to RFC 1918, but somewhat more complicated.  You might find
https://www.sixxs.net/tools/grh/ula/ relevant too, although actually
using that as a registry is pretty pointless.

	Cheers,

	Matthew

--=20
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
JID: matthew@infracaninophile.co.uk               Kent, CT11 9PW


--------------enig7948054E1E4628BD4CCF03D2
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8DQmQACgkQ8Mjk52CukIxmogCfZ8ZflIBKLEcdwO+KDgKCkh92
Hu8AnjMnInGGOB/d07duUWMLV8Sz45xv
=ofZl
-----END PGP SIGNATURE-----

--------------enig7948054E1E4628BD4CCF03D2--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F03425C.6040104>