nanog mailing list archives

Re: IPv6 Netowrk Device Numbering BP


From: Chip Marshall <chip () 2bithacker net>
Date: Thu, 1 Nov 2012 13:43:14 -0400

On 01-Nov-2012, Owen DeLong <owen () delong com> sent:
The only exceptions to this parsing would be if someone handed
you a textual representation of an IPv4 mapped address
(::ffff:192.0.2.50), which essentially represents the partial
decimal format Masataka is requesting.

I might be missing something here, but isn't that format already
valid for any IPv6 address, not just the special v4-in-v6
representation?

import socket
p = '2001:abcd::192.16.10.10'
n = socket.inet_pton(socket.AF_INET6, p)
socket.inet_ntop(socket.AF_INET6, n)
'2001:abcd::c010:a0a'

Or is the issue just the ntop part not giving you back the
decimalized string?

-- 
Chip Marshall <chip () 2bithacker net>
http://weblog.2bithacker.net/          KB1QYW        PGP key ID 43C4819E
v4sw5PUhw4/5ln5pr5FOPck4ma4u6FLOw5Xm5l5Ui2e4t4/5ARWb7HKOen6a2Xs5IMr2g6CM

Attachment: _bin
Description:


Current thread: