LLT-7068: Adapter MTU API - #1978
Open
stalowyjez wants to merge 13 commits into
Open
Conversation
stalowyjez
force-pushed
the
LLT-7068_adapter_mtu_api
branch
from
September 7, 2026 15:57
12cb54d to
9e424f3
Compare
tomaszklak
reviewed
Sep 9, 2026
stalowyjez
force-pushed
the
LLT-7068_adapter_mtu_api
branch
from
September 9, 2026 17:35
b8233bb to
d962937
Compare
stalowyjez
force-pushed
the
LLT-7068_adapter_mtu_api
branch
from
September 11, 2026 09:59
d962937 to
307f419
Compare
tomaszklak
reviewed
Sep 11, 2026
tomaszklak
left a comment
Contributor
There was a problem hiding this comment.
Please cleanup the commit history (move review fixes to appropriate commits, so that they already appear in the final correct form).
Comment on lines
+175
to
+182
| #[cfg(not(target_os = "windows"))] | ||
| let tun = self.tun.map(|fd| { | ||
| use std::os::fd::{FromRawFd, OwnedFd}; | ||
| // SAFETY: the caller hands over an open descriptor it no longer uses | ||
| unsafe { OwnedFd::from_raw_fd(fd) } | ||
| }); | ||
| #[cfg(target_os = "windows")] | ||
| let tun = None; |
Contributor
There was a problem hiding this comment.
I think it would be best to move this right before the return. Otherwise the failed mtu check will close the fd passed by the caller.
| family, | ||
| err | ||
| ); | ||
| if failed { |
Contributor
There was a problem hiding this comment.
Should we undo the effects of set_forced_mtu(Some(...)) here?
| // * start - telio does everything | ||
| // * start_with_tun - use existing tun (android, apple) | ||
| // * start_with_name - create tun with name (windows, linux) | ||
| // * start_with_config - like start, with optional settings (name, ext_if_filter, mtu) |
Contributor
There was a problem hiding this comment.
Here (and in other places) not all settings are listed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Currently there is no way to set MTU for any adapter while it can be added and it would be useful for some telio users
Solution
Two ways of configuring MTU are added: adding in during adapter startup and
set_mtuusable on running device. Because there are already many adapter starting functions I think instead of adding to each of them another version with mtu argument I think it makes more sense to add a config with optional fields and MTU among them. The solution works currently only with WindowsNT adapter, returns an error when used with other one.☑️ Definition of Done checklist