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

fake IFF_NO_PI on macOS #19

Merged
merged 1 commit into from
Mar 20, 2017
Merged

fake IFF_NO_PI on macOS #19

merged 1 commit into from
Mar 20, 2017

Conversation

songgao
Copy link
Owner

@songgao songgao commented Mar 15, 2017

@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

@songgao songgao force-pushed the songgao/fake-NO_PI branch 2 times, most recently from 37433be to 7ae4670 Compare March 15, 2017 05:14
@songgao songgao merged commit 3a225b3 into master Mar 20, 2017
@songgao songgao deleted the songgao/fake-NO_PI branch March 20, 2017 17:00
@eliezedeck
Copy link

Looks like you didn't see my review?

@songgao
Copy link
Owner Author

songgao commented Mar 20, 2017

@eliezedeck No I didn't; sorry! Did you start a review without hitting "Submit Review"?

@eliezedeck
Copy link

I think I clicked the "Submit Review" button indeed.

}
t.wBuf = t.wBuf[:len(from)+4]

t.wBuf[0] = 2 // Family: IP (2)

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.

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)

Copy link
Owner Author

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!

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.

@eliezedeck
Copy link

Damn, I think I didn't click it. Meh! Sorry about that.

songgao added a commit that referenced this pull request Mar 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants