Page MenuHomeFreeBSD

netlink: Handle `ifhwioctl(SIOCSIFMTU)` failure
ClosedPublic

Authored by obiwac on Aug 22 2025, 8:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 13, 12:16 PM
Unknown Object (File)
Mon, Oct 13, 12:16 PM
Unknown Object (File)
Mon, Oct 13, 12:16 PM
Unknown Object (File)
Mon, Oct 13, 12:16 PM
Unknown Object (File)
Sun, Oct 12, 11:40 PM
Unknown Object (File)
Fri, Oct 3, 10:53 AM
Unknown Object (File)
Thu, Oct 2, 2:18 PM
Unknown Object (File)
Thu, Oct 2, 3:38 AM

Details

Summary

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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.