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 MTU conflict with mieru plugin #529

Merged
merged 2 commits into from
Jan 28, 2024
Merged

Fix MTU conflict with mieru plugin #529

merged 2 commits into from
Jan 28, 2024

Conversation

enfein
Copy link
Contributor

@enfein enfein commented Jan 18, 2024

This bug was reported in enfein/mieru#111.

As shown in app/src/main/java/io/nekohasekai/sagernet/database/DataStore.kt, NekoBox has two data stores:

  1. configurationStore is used to store global app configuration
  2. profileCacheStore is used to store each proxy profile

Previously, MieruSettingsActivity.kt uses var mtu by configurationStore.stringToInt(Key.MTU) to store the mieru MTU configuration. This has two problems. First, a mieru setting will override the global MTU configuration used by the VpnService. Second, two mieru settings can override each other.

To fix this, we introduce a new field var serverMTU by profileCacheStore.stringToInt(Key.SERVER_MTU) to store the mieru MTU configuration. We confirmed that the APK built from https://github.com/enfein/NekoBoxForAndroid/actions/runs/7550857326 resolved this bug.

@enfein
Copy link
Contributor Author

enfein commented Jan 22, 2024

@purofle Can you help to review? Thank you.

@purofle purofle merged commit f66437c into MatsuriDayo:main Jan 28, 2024
@enfein enfein deleted the mieru branch January 29, 2024 01:00
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