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

Cope with clients using the broadcast address #89

Merged
merged 1 commit into from
Oct 28, 2023

Conversation

AlbanBedel
Copy link
Contributor

Some clients use the broadcast address (255.255.255.255) to reach the TFTP server in their network. This currently doesn't work because the server then use this address as the source address in its responses. But the broadcast address is not a valid source address and the sendmsg call fail with an invalid argument error.

To cope with this check if the source address is the broadcast address and if so replace it with 0.0.0.0 to use the OS default.

Some clients use the broadcast address (255.255.255.255) to reach the
TFTP server in their network. This currently doesn't work because the
server then use this address as the source address in its responses.
But the broadcast address is not a valid source address and the
sendmsg call fail with an `invalid argument` error.

To cope with this check if the source address is the broadcast address
and if so replace it with 0.0.0.0 to use the OS default.

Signed-off-by: Alban Bedel <[email protected]>
@pin
Copy link
Owner

pin commented Oct 28, 2023

LGTM!

Apology for slow review.

@pin pin merged commit 5fda30d into pin:master Oct 28, 2023
3 checks passed
@pin pin mentioned this pull request Oct 29, 2023
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