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

This patch addresses two issues: #5

Merged
merged 1 commit into from
Jan 8, 2018
Merged

Conversation

mpghf
Copy link
Contributor

@mpghf mpghf commented Jan 8, 2018

A small socket receive buffer can result in a buffer overflow (and lost ping replies) if many fast targets are pinged. The receive buffer has accordingly been enlarged to 131072 bytes. In the long run this should probably be varied according to the number of pinged targets.

The second issue is that the errno values are currently hard-coded. On platforms other than Windows and Linux this causes trouble. Rather use the values defined in the errno package: errno.EWOULDBLOCK, which resolves to 11 on Linux, 10035 on Windows, 35 on FreeBSD, and other values on other platforms.

A small socket receive buffer can result in a buffer overflow (and lost ping replies) if many fast targets are pinged.  The receive buffer has accordingly been enlarged to 131072 bytes.  In the long run this should probably be varied according to the number of pinged targets.

The second issue is that the errno values are currently hard-coded.  On platforms other than Windows and Linux this causes trouble.  Rather use the values defined in the errno package: errno.EWOULDBLOCK, which resolves to 11 on Linux, 10035 on Windows, 35 on FreeBSD, and other values on other platforms.
@jbrendel
Copy link
Contributor

jbrendel commented Jan 8, 2018

Thank you for your contribution, very nice.

@jbrendel jbrendel merged commit a05749a into romana:master Jan 8, 2018
@jbrendel jbrendel mentioned this pull request Jan 8, 2018
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.

None yet

2 participants