-
Notifications
You must be signed in to change notification settings - Fork 24
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
ndp.Dial uses (*icmp.PacketConn).SetChecksum which is not implemented on Windows #23
Comments
I just noticed that the second possible solution is closely related to #10. So maybe both issues can be resolved together. |
Option 3 seems reasonable to me for now, though honestly I have no idea which other parts of x/net/* work on Windows as I am on *nix 99% of the time. A PR would be welcome for that option. As for #10, I'll think on that some more but don't plan to do it immediately. Thanks! |
Okay I can submit a PR. But first, could you tell me why |
Honestly I consider Windows support for any of my libraries to be best effort and would rather not change any existing functionality for Unix. It's been a long time since I've reviewed this code so let's make the minimum change to get Windows working and leave everything else alone for now. |
As far as I am aware, this module cannot be used on Windows because the
ndp.Dial
method returnserrNotImplemented
. This error originates from the following call to(*icmp.PacketConn).SetChecksum
:ndp/conn.go
Lines 66 to 70 in 17ab9e3
Now, I don't know that much about
ndp
, however, during my testing, at least sending router advertisements seemed to work just fine when the call toSetChecksum
was removed. Disclaimer: I do not know why this call is necessary and what may break if it is removed. However, if it is indeed optional, I would propose the following solutions:1. Separate
ndp.Dial
for WindowsImplement a seperate
ndp.Dial
function with Windows build tags where the lines above are removed.2. Allowing users to setup the connection themselves
Almost everything in
ndp.Dial
can be done by the user itself. However, at the endndp.newConn
is used to construct a*ndp.Conn
from an*icmp.PacketConn
. Asndp.newConn
is not exported and as all properties ofndp.Conn
are also private, this currently cannot be done by the user. Ifndp.newConn
was exported, users could work around this issue themselves. This solution would also work fine alongsidendp.Dial
as it grants the user more flexibility to work around future issues.3. Skipping
SetChecksum
at runtime on WindowsAnother less preferable solution would be to just skip the
SetChecksum
call on Windows at runtime as follows:If you decide on a preferred solution, I could also create a PR if you want.
The text was updated successfully, but these errors were encountered: