Page MenuHomeFreeBSD

Move list_cloners to libifconfig
ClosedPublic

Authored by freqlabs on Oct 19 2020, 1:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 8 2024, 8:00 AM
Unknown Object (File)
Mar 8 2024, 8:00 AM
Unknown Object (File)
Mar 8 2024, 8:00 AM
Unknown Object (File)
Mar 8 2024, 8:00 AM
Unknown Object (File)
Mar 8 2024, 7:48 AM
Unknown Object (File)
Dec 22 2023, 11:25 PM
Unknown Object (File)
Dec 8 2023, 5:54 AM
Unknown Object (File)
Aug 29 2023, 4:48 PM
Subscribers

Details

Summary

Move list_cloners() from ifconfig(8) to libifconfig(3) where it can be reused by other consumers.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kp added a subscriber: kp.

I love to see more ifconfig code move into libifconfig.

sbin/ifconfig/ifclone.c
66 ↗(On Diff #78426)

I don't know if it's worth worrying about the different possible causes of error here. Is the distinction between an error opening the socket and an error in the ioctl actionable by users? It's not as if we do anything different for any of them, other than the actual error message.

Developers will almost certainly just truss the thing to figure out which call failed.

Alternatively, should we start thinking about a more generic libifconfig function to produce a useful error string?

This revision is now accepted and ready to land.Oct 19 2020, 1:59 PM
sbin/ifconfig/ifclone.c
66 ↗(On Diff #78426)

I agree with both points. My original thought was to just print some "failed to do the thing" type message, but then opted to try preserving the existing error messages as best I could and looked for some libifconfig error description method which I did not find.

I'll simplify the error messages here for now and put thinking about a generic method for libifconfig on the TODO list for later.

This revision now requires review to proceed.Oct 20 2020, 9:15 AM
This revision is now accepted and ready to land.Oct 20 2020, 3:47 PM
This revision was automatically updated to reflect the committed changes.