-
Notifications
You must be signed in to change notification settings - Fork 447
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
Allow receiving broadcast packets in UDP #66
Conversation
The destination address is not checked to see if it is the broadcast address before sending ICMP error responses currently (RFC 1122 § 3.2.2). Currently this conditional is the only thing keeping us from causing a broadcast storm due to a weird broadcast packet. The specific panic is here, and is due to the packet created for the |
@dlrobertson Wow, your tests already paid off. Thanks a lot! |
@whitequark, I believe @dlrobertson is working on a fix, to prevent the ICMP error message from being sent |
After a rebase, tests should pass here. |
@jackpot51 Can you rebase? |
Yep, will do |
@whitequark it is done |
Any chance you can write a test for this? |
Sure! |
@whitequark I do not see any current tests for UDP in the ethernet interface, am I mistaken? |
@jackpot51 https://github.com/m-labs/smoltcp/blob/master/src/iface/ethernet.rs#L828-L911 is an example of a test in the ethernet interface for UDP. Essentially you could do the same thing as the second half of that test, but add a socket to the socket set that is listening to the port of interest. |
Ok, cool |
Add test for the processing of a UDP broadcast packets by `InterfaceInner`.
@jackpot51 ping? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs tests
Sorry @whitequark, I have been busy porting cargo. |
I added tests with redox-os/smoltcp#1 |
Add test for UDP broadcast processing
@whitequark the tests from @dlrobertson are now merged |
This allows the reception of UDP broadcast packets. They will fall through to the process_udp function. The tcp and icmp functions also receive potential broadcast packets, but they should already be discarded.