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

Remove panic on missing candidates #473

Closed
thomaseizinger opened this issue Mar 5, 2024 · 3 comments · Fixed by #493
Closed

Remove panic on missing candidates #473

thomaseizinger opened this issue Mar 5, 2024 · 3 comments · Fixed by #493

Comments

@thomaseizinger
Copy link
Collaborator

thomaseizinger commented Mar 5, 2024

The following panic can be triggered if the IceAgent is being fed "wrong" data:

str0m/src/ice/agent.rs

Lines 1166 to 1168 in eb0fbe0

.expect(
"STUN request for socket that is neither a host nor a relay candidate. This is a config error.",
)

I'd argue that we should remove this panic and instead just drop the message. This can for example be triggered if the IceAgent is not configured with a host candidate but only with srflx candidates. I don't really see why that wouldn't be valid?

Generally, I don't think we should ever panic if the user hands us bad socket addresses or data within Receive / StunPacket. I'd prefer if we log a warn! and drop the packet. We are after all exposed to network traffic here and should gracefully handle whatever is thrown at us.

@algesten
Copy link
Owner

algesten commented Mar 5, 2024

Yeah, agree. Panic is a bit much. Dropping the packet seem reasonable.

@algesten
Copy link
Owner

This has been addressed right?

@thomaseizinger
Copy link
Collaborator Author

This has been addressed right?

Nope! Not as far as I know.

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 a pull request may close this issue.

2 participants