Skip to content

Conversation

nemosupremo
Copy link
Contributor

This PR replaces the usage of select with poll on linux. select has a limitation that the number of descriptors and the actual descriptor value must be lower than FD_SETSIZE which is 1024[1]. The number of descriptor isn't an issue, however if a socket is created that has an FD that is greater than 1024, this will cause libc::FD_SET to panic.

To fix this, instead of using select, we can use poll. poll does not have this limitation. This PR replaces libc::pselect with libc::poll

This fixes #612 and #639.

[1] https://linux-tips.com/t/is-it-possible-to-listen-file-descriptor-greater-than-1024-with-select/45

@mrmonday mrmonday merged commit 49c8c68 into libpnet:main May 30, 2024
@mrmonday
Copy link
Contributor

Looks good, thanks!

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.

Panicked at 'index out of bounds When using pnet_datalink to send arp request
2 participants