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/ipv[46]: ControlMessage unimplemented on Windows #20153

Closed
tmm1 opened this issue Apr 27, 2017 · 3 comments
Closed

x/net/ipv[46]: ControlMessage unimplemented on Windows #20153

tmm1 opened this issue Apr 27, 2017 · 3 comments

Comments

@tmm1
Copy link
Contributor

tmm1 commented Apr 27, 2017

Both x/net/ipv4 and x/net/ipv6 return EWINDOWS and have "TODO: implement this" comments:

https://github.com/golang/net/blob/master/ipv4/control_windows.go
https://github.com/golang/net/blob/master/ipv6/control_windows.go

It appears that Windows has a WSARecvMsg which provides access to the underlying control messages:

For datagrams received by the WSARecvMsg function over IPv4, the Control member of the WSAMSG structure received will contain a WSABUF structure that contains a WSACMSGHDR structure. The cmsg_level member of this WSACMSGHDR structure would contain IPPROTO_IP, the cmsg_type member of this structure would contain IP_PKTINFO, and the cmsg_data member would contain an in_pktinfo structure used to store received IPv4 packet address information. The IPv4 address in the in_pktinfo structure is the IPv4 address from which the packet was received.

I couldn't find any mentions of WSARecvMsg in the golang source. Indeed, it appears that netFD.readMsg is unimplemented as-well on windows:

return 0, 0, 0, nil, syscall.EWINDOWS

So I guess the first step would be to add a syscall wrapper for WSARecvMsg and then implement netFD.readMsg on top of it?

cc @mikioh

@mikioh
Copy link
Contributor

mikioh commented Apr 28, 2017

Sure, #9252, then #7174 and #7175.

@alexbrainman
Copy link
Member

@tmm1 feel free to send me CLs for review.
I will help in whatever way I can.

Alex

@mikioh
Copy link
Contributor

mikioh commented Apr 28, 2017

I'll merge this issue into #7175.

@mikioh mikioh closed this as completed Apr 28, 2017
@golang golang locked and limited conversation to collaborators Apr 28, 2018
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

4 participants