Skip to Content [alt-c]
In reply to Comment by Reader Arkadiy Tetelman
Hi Arkadiy - I'm glad my post was useful!
You wrote:
For instance I could make a request to the ipv6 address ::ffff:169.254.169.254 and access your cloud provider metadata service.
I just tried this and my code properly rejects ::ffff:169.254.169.254: https://play.golang.org/p/If7PWPTrtU1
::ffff:169.254.169.254
My code works properly because 169.254.0.0/16 is listed in reservedIPv4Nets, and Go's IPNet.Contains considers IPv4 and IPv4-mapped IPv6 addresses to be equivalent. Therefore, there is no need to separately enumerate reserved IPv4 addresses in mapped IPv6 form.
169.254.0.0/16
reservedIPv4Nets
IPNet.Contains
Reply
Your comment will be public. To contact me privately, email me. Please keep your comment polite, on-topic, and comprehensible. Your comment may be held for moderation before being published.
Your Name: (Optional; will be published)
Your Email Address: (Optional; will not be published)
Your Website: (Optional; will be published)
>
monospaced
Post a Reply
Your comment will be public. To contact me privately, email me. Please keep your comment polite, on-topic, and comprehensible. Your comment may be held for moderation before being published.