Merged
Conversation
6ee376e to
94baaa9
Compare
Member
|
Apologies for the late reply from our end. Looking into this now and will update you shortly. |
Contributor
Author
|
For reference, linux's implementation sets the bit mask before every libpnet/pnet_datalink/src/linux.rs Line 248 in dc2203a |
Member
|
This is a nice catch, thanks a lot for fixing it @zhangxp1998. I just went over the diff and have no issues with this. Will be merging shortly :-) Do you require a version bump? |
Contributor
Author
Yes please! |
Member
|
@zhangxp1998 -- version bump in progress. Bear with me if I'm a tad slow. :-) |
Merged
Member
|
@zhangxp1998 Version has been bumped to 0.25.0 |
Contributor
Author
Awesome! Thanks a lot! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per
pselectman pages, thekth bit ofself.fd_setmust be set if we are interested in file descriptork. libpnet does this once in here, when the datalink receiver/sender is initialized. However, if no descriptors are available during apselectcall, the kernel will clearself.fd_set, and next time when pnet callspselect, it will pass afd_setwith all bits 0. The kernel will interpret this as "I don't care if any of the file descriptors are available", and will happily return 0 even if there are some packets available. See screenshot, all bits in thefd_setbit mask are set to 0(this is not supposed to happen!).This caused an issue in another rust open source project, see discussion here.