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

Fix not working MTU exchange on newer versions of mac #192

Merged
merged 1 commit into from
Jul 13, 2023

Conversation

m-gorecki
Copy link
Contributor

@m-gorecki m-gorecki commented Dec 12, 2022

It seems like on newer versions of mac (e.g. Monterey) fix with looping three times to get right MTU doesn't work. Also for some strange reason default TxMTU is set to 17 instead of 23. Now user can set MTU from the command line (-m ). If MTU is not set in the command line and after performing three loops MTU is still <23 we hardcode it to 185.

@m-gorecki
Copy link
Contributor Author

@ccollins476ad I know this is dirty hack, but we had no better idea to fix this. This way image upload over ble at least works (unless the boards MTU turns out to be less than 185).

// On some versions of mac (e.g. monterey) workaround with
// looping three times seems to not work anymore. If after
// performing three loops MTU is still <=23 than hardcode it to 185.
if mtu <= bledefs.BLE_ATT_MTU_DFLT {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is perfectly fine to end with default MTU after MTU exchange, we should consider overriding MTu only if it is invalid ( less than default)

It seems like on newer versions of mac (e.g. Monterey)
fix with looping three times to get right MTU
doesn't work. Also for some strange reason default TxMTU
is set to 17 instead of 23. Now user can set MTU from
the command line (-m <MTU value>).
If MTU is not set in the command line and after performing
three loops MTU is still <23 we hardcode it to 185.
@sjanc sjanc merged commit 5fa2e0f into apache:master Jul 13, 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