Skip to content

libnet/d/bridge: unconditionally error out if LinkSetMTU fails#49092

Merged
thaJeztah merged 1 commit intomoby:masterfrom
akerouanton:dont-ignore-linksetmtu-error
Dec 14, 2024
Merged

libnet/d/bridge: unconditionally error out if LinkSetMTU fails#49092
thaJeztah merged 1 commit intomoby:masterfrom
akerouanton:dont-ignore-linksetmtu-error

Conversation

@akerouanton
Copy link
Copy Markdown
Member

@akerouanton akerouanton commented Dec 14, 2024

Related to:

- What I did

Since 89470a7 we ignore errors returned by LinkSetMTU when the MTU is greater than 1500 but lower than 65535 to let CentOS/RHEL 7 users set an MTU in that range (despite their kernel rejecting that value).

We dropped support for those distros, so we can now remove this code and unconditionally error out if LinkSetMTU returns an error.

Commit 89470a7 introduced two unit tests - these are kept, and both now have a proper GoDoc describing what they're testing.

- How to verify it

Existing unit tests.

@akerouanton akerouanton added status/2-code-review area/networking Networking kind/refactor PR's that refactor, or clean-up code area/networking/d/bridge Networking labels Dec 14, 2024
@akerouanton akerouanton added this to the 28.0.0 milestone Dec 14, 2024
@akerouanton akerouanton self-assigned this Dec 14, 2024
@akerouanton akerouanton changed the title libnet/d/bridge: unconditionnally error out if LinkSetMTU fails libnet/d/bridge: unconditionally error out if LinkSetMTU fails Dec 14, 2024
@akerouanton akerouanton force-pushed the dont-ignore-linksetmtu-error branch from 13cf2a2 to 99cb0cb Compare December 14, 2024 10:21
Since 89470a7 we ignore errors returned by `LinkSetMTU` when the MTU is
greater than 1500 but lower than 65535 to let CentOS/RHEL 7 users set
an MTU in that range (despite their kernel rejecting that value).

We dropped support for those distros, so we can now remove this code
and unconditionally error out if `LinkSetMTU` returns an error.

Commit 89470a7 introduced two unit tests - these are kept, and both now
have a proper GoDoc describing what they're testing.

Signed-off-by: Albin Kerouanton <[email protected]>
@akerouanton akerouanton force-pushed the dont-ignore-linksetmtu-error branch from 99cb0cb to 678ef1a Compare December 14, 2024 10:23
@thaJeztah
Copy link
Copy Markdown
Member

Bonus points; this fixes #47312 😄

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah merged commit 1ce3474 into moby:master Dec 14, 2024
@akerouanton akerouanton deleted the dont-ignore-linksetmtu-error branch December 14, 2024 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/networking/d/bridge Networking area/networking Networking kind/refactor PR's that refactor, or clean-up code status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: add godoc to MTU tests

2 participants