Page MenuHomeFreeBSD

netlink: Handle `ifhwioctl(SIOCSIFMTU)` failure
ClosedPublic

Authored by obiwac on Aug 22 2025, 8:29 PM.
Tags
None
Referenced Files
F147503594: D52132.id160970.diff
Wed, Mar 11, 12:03 PM
F147494319: D52132.id.diff
Wed, Mar 11, 10:22 AM
F147488019: D52132.id160846.diff
Wed, Mar 11, 9:24 AM
Unknown Object (File)
Wed, Mar 11, 6:08 AM
Unknown Object (File)
Mon, Mar 9, 4:51 PM
Unknown Object (File)
Thu, Mar 5, 7:33 AM
Unknown Object (File)
Mon, Mar 2, 9:17 PM
Unknown Object (File)
Jan 22 2026, 11:03 PM

Details

Summary

Print out error message if setting MTU fails when modifying interface
using netlink.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 66474
Build 63357: arc lint + arc unit

Event Timeline

All good, just a note (mostly to myself) on error handling and atomicity. What we do here (myself included) is sequence on priv-check & execute calls, where we stop abruptly half-way if we lack privilege for 1 out of 10 changes. The outcome (e.g. partial change) is now dependent on the block order inside the function.
What we should do instead is either try to move towards more atomicity (checking all privileges in the beginning and failing) or more overall completion (e.g. don't stop on the first failure), which is harder reporting-wise.
Generally I'd prefer the former approach. I don't think we need to change it here, I'd rather have a separate diff reshuffling error handling approach.

This revision is now accepted and ready to land.Aug 23 2025, 12:09 PM

All good, just a note (mostly to myself) on error handling and atomicity. What we do here (myself included) is sequence on priv-check & execute calls, where we stop abruptly half-way if we lack privilege for 1 out of 10 changes. The outcome (e.g. partial change) is now dependent on the block order inside the function.
What we should do instead is either try to move towards more atomicity (checking all privileges in the beginning and failing) or more overall completion (e.g. don't stop on the first failure), which is harder reporting-wise.
Generally I'd prefer the former approach. I don't think we need to change it here, I'd rather have a separate diff reshuffling error handling approach.

Also like the sound of the former approach more. I (or @saheed ?) can work on doing this if you'd like.

mckusick added a subscriber: mckusick.

Mentor approval.