Skip to Content [alt-c]


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: and access your cloud provider metadata service.

I just tried this and my code properly rejects ::ffff:

My code works properly because 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.


Post a Reply

Your comment will be public. If you would like to contact me privately, please email me. Please keep your comment on-topic, polite, and comprehensible.

(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.
  • 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.