Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/net/ipv6: all-{nodes,routers} or solicited-node multicast addresses? #17050

Closed
porjo opened this issue Sep 10, 2016 · 1 comment
Closed

x/net/ipv6: all-{nodes,routers} or solicited-node multicast addresses? #17050

porjo opened this issue Sep 10, 2016 · 1 comment

Comments

@porjo
Copy link

porjo commented Sep 10, 2016

There doesn't appear to be a way to read multicast packets not destined for the local host when using net.PacketConn.

I'm trying to use x/net/ipv6 as follows:

    var c net.PacketConn
    c, err = net.ListenPacket("ip6:ipv6-icmp", ifaceIP.String())
...
    p := ipv6.NewPacketConn(c)
    err = p.SetControlMessage(ipv6.FlagSrc|ipv6.FlagDst, true)
...
    var f ipv6.ICMPFilter
    f.SetAll(true)
    f.Accept(ipv6.ICMPTypeNeighborSolicitation)
    f.Accept(ipv6.ICMPTypeNeighborAdvertisement)
    err = p.SetICMPFilter(&f)
...
    payload := make([]byte, snaplen)
    i, rcm, src, err := p.ReadFrom(payload)
...

I would like to read, for example, IPv6 neighbor solicitations where the destination solicited-node multicast address does not belong to the local host.

Can this be done with the standard lib (i.e. not using pcap library)? If not, could it be added? Thanks.

go version go1.6.3 linux/amd64

@mikioh mikioh changed the title net.PacketConn - allmulticast ? x/net/ipv6: all-{node,routers} or solicited node multicast addresses? Sep 10, 2016
@mikioh mikioh added this to the Unreleased milestone Sep 10, 2016
@mikioh
Copy link
Contributor

mikioh commented Sep 10, 2016

In accordance with https://golang.org/wiki/Questions, please use golang-nuts instead. FWIW, the packages x/net/{ipv4,ipv6,icmp} are designed for helping implementing userland IP control plane applications, so in general it's possible to read any multicast address defined in RFC 4291. If you think the current package documentation is insufficient, please open a new issue.

@mikioh mikioh closed this as completed Sep 10, 2016
@mikioh mikioh changed the title x/net/ipv6: all-{node,routers} or solicited node multicast addresses? x/net/ipv6: all-{nodes,routers} or solicited-node multicast addresses? Sep 10, 2016
@golang golang locked and limited conversation to collaborators Sep 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants