Skip to content

net/netip: add IPv6LinkLocalAllRouters #51766

@mdlayher

Description

@mdlayher

I'm working on porting some of my networking packages to Go 1.18's net/netip, but it seems that I had forgotten about my uses of net.IPv6linklocalallrouters when I was making regular additions to inet.af/netaddr.

I'd like to suggest adding exactly the following to net/netip, akin to what already exists as netip.IPv6LinkLocalAllNodes:

// IPv6LinkLocalAllRouters returns the IPv6 link-local all routers multicast
// address ff02::2.
func IPv6LinkLocalAllRouters() Addr { return AddrFrom16([16]byte{0: 0xff, 1: 0x02, 15: 0x02}) }

Along with link-local all nodes, this is one of the most fundamental IPv6 multicast group addresses. Package net exposes it today as a variable: https://pkg.go.dev/net#pkg-variables

Thanks!

/cc @bradfitz @danderson @josharian

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions