-
Notifications
You must be signed in to change notification settings - Fork 194
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
panic when reading wifi scan results with unkown? auth mode #333
Comments
I think we should do the following:
If you are willing to work on a PR, I can support with feedback/suggestions. |
... and thank you for the analysis! |
Is there a good reason against adding a AuthMethod.Unknown instead and use this instead of the panic? |
If the wifi is open, you'll get `Some(AuthMethod::None), not Option::None. And then ask yourself the question what shall we do when you put |
Ah ok that makes sense, impossible to represent invalid invariant then I think I want to do this in in multiple steps, first getting it to not crash and the new auth methods then after that. Any ideas how to get rid of the now new unwraps? Or make the other From return Option as well, as it cannot be converted in case of a unknown auth method? |
Ok, I think I have a acceptable version now, sadly I did not manage to understand where the wifi_auth_mode_t is mapped so I did not manage to add the ~3 additional auth methods mentioned in the documentation |
The suggested PR was merged, so let's close it. |
When running the following snipped:
I get the following output and panic:
This is caused by this panic:
A) Should this missing auth method be addded here?
B) If possible I would like to see a AuthMethod::Invalid or similar for these cases, as crashing a running application during a scan is something I would not expect to happen, after all crashing random devices with a wifi killer device is not something that I want.
I'm not really proficient with Rust, but I can try to do a pull request, especially for the B) case.
I have checked all ap's my laptop can find via "iwlist wlan0 scan" on channel 6, especially Cell 10 seems to be noteworthy for me due to it returning: Authentication Suites (1) : unknown (18) which kinda fits.
If there is anything additionally I can submit to help, or I should try to add a unknown enum type
The text was updated successfully, but these errors were encountered: