Skip to Content [alt-c]

Comment

In reply to Comment by Reader Arkadiy Tetelman

Andrew Ayer on 2020-01-05 at 23:40:

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

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.

Reply

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.

(Optional; will be published)

(Optional; will not be published)

(Optional; will be published)

  • Blank lines separate paragraphs.
  • Lines starting with > are indented as block quotes.
  • Lines starting with two spaces are reproduced verbatim (good for code).
  • Text surrounded by *asterisks* is italicized.
  • Text surrounded by `back ticks` is monospaced.
  • URLs are turned into links.
  • Use the Preview button to check your formatting.