Skip to content

TunTapInterface: do not automatically enable medium-ethernet feature when phy-tuntap_interface is enabled #1055

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tomkris
Copy link

@tomkris tomkris commented Apr 18, 2025

TunTapInterface can work in TUN L3 mode which does not require medium-ethernet feature. TunTapInterface already mostly respects medium-ethernet feature flag and enables relevant TAP L2 functionality only when medium-ethernet is enabled.

However, in Cargo.toml features configuration automatically enables medium-ethernet feature when phy-tuntap_interface feature is enabled, making it impossible to opt-out of Ether support when using TUN L3 interfaces.

In this change I'm updating Cargo.toml to not enable medium-ethernet feature when phy-tuntap_interface feature is enabled. With this change phy-tuntap_interface supports TUN L3 interfaces only by default. Users who want to use TAP L2 interfaces have to enable the support by enabling medium-ethernet in addition to phy-tuntap_interface

I confirmed that build passes in configuration where phy-tuntap_interface is enabled but medium-ethernet is not:

cargo build --no-default-features --features medium-ip,proto-ipv4,socket-tcp,phy-tuntap_interface

…when phy-tuntap_interface is enabled

`TunTapInterface` can work in TUN L3 mode which does not require `medium-ethernet` feature. `TunTapInterface`
already mostly respects `medium-ethernet` feature flag and enables relevant TAP L2 functionality only when
`medium-ethernet` is enabled.

However, in Cargo.toml features configuration automatically enables `medium-ethernet` feature when `phy-tuntap_interface`
feature is enabled, making it impossible to opt-out of Ether support when using TUN L3 interfaces.

In this change I'm updating Cargo.toml to not enable `medium-ethernet` feature when `phy-tuntap_interface` feature is
enabled. With this change `phy-tuntap_interface` supports TUN L3 interfaces only by default.
Users who want to use TAP L2 interfaces have to enable the support by enabling `medium-ethernet` in addition to `phy-tuntap_interface`

I confirmed that build passes in configuration where `phy-tuntap_interface` is enabled but `medium-ethernet` is not:

```
cargo build --no-default-features --features medium-ip,proto-ipv4,socket-tcp,phy-tuntap_interface
```
Copy link

codecov bot commented Apr 18, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 81.17%. Comparing base (f8bfa31) to head (37f54ba).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/phy/sys/tuntap_interface.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1055   +/-   ##
=======================================
  Coverage   81.17%   81.17%           
=======================================
  Files          81       81           
  Lines       28956    28956           
=======================================
  Hits        23505    23505           
  Misses       5451     5451           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant