-
Notifications
You must be signed in to change notification settings - Fork 294
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
fake IFF_NO_PI on macOS #19
Conversation
37433be
to
7ae4670
Compare
Looks like you didn't see my review? |
@eliezedeck No I didn't; sorry! Did you start a review without hitting "Submit Review"? |
I think I clicked the "Submit Review" button indeed. |
} | ||
t.wBuf = t.wBuf[:len(from)+4] | ||
|
||
t.wBuf[0] = 2 // Family: IP (2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this is the right byte index?
In my #18 bug report, it was the 4th byte, not the 1st (index 3) which has been set to 2
:
copy(writePrepare[:], []byte{0, 0, 0, 2})
I don't have time to test because I'm very busy with some other things right now. But other than this one, I think it's good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My correction is thus:
t.wBuf[3] = 2 // Family: IP (2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah interesting. I tested it on my machine. I guess I missed something. I'll revert this PR for now, and fix it later today or this week. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well that's always the byte sequence that macOS produces, and I guessed that's what I should also reuse when writing. And that worked.
Damn, I think I didn't click it. Meh! Sorry about that. |
@eliezedeck I'm pushing this as a PR so that you can review it if you get a chance. Please let me know if this looks good to you. Thanks!
There doesn't seem to be a way to tell darwin kernel to drop the 4-byte packet information. I guess a better solution would be to use
tuntaposx
as mentioned in TODO.Resolves #18