Matt Layher

Results 197 comments of Matt Layher

Thanks for that. The example should be pretty easy to fix. As for the socket options, that is a strange one that I'll have to look into.

I think my concern with a zero-value unspecified address is that we support both IPv4 and IPv6, and it would be ambigious as to which (or both?) would be represented...

That's a good point. Would `var ip netaddr.IP` then imply "dual-stack unspecified IP address"? Would it be coerced to IPv4 or IPv6 unspecified in some other place in the API?...

> Yes. I at least plan to add As6() IP that would pack a 4-in-6, and it could also turn the zero value IP into the IPv6 unspecified address. This...

Map sounds good to me. I agree that it is probably best to try to avoid another To4/To16 situation.

It's been 8ish months and I personally haven't run into a need for this. Any further thoughts on the matter?

Option 1 seems the most straightforward to me.

I agree with Dave's assessment. In IPv6 there is already disagreement about whether ULA are "public" or not and I'm sure there are other ranges with similar questions.

We now have IsGlobalUnicast, IsPrivate, and IsUnspecified. In theory callers could just `!ip.IsPrivate()` at this point to exclude RFC1918 and ULAs.

Also with generics on the horizon it's possible that building such a thing might be a lot more ergonomic in a year or two. I personally wouldn't mind yolo changing...