Page MenuHomeFreeBSD

Modify ifname_linux_to_bsd() to properly work with Linux loopback interface
ClosedPublic

Authored by dchagin on May 2 2019, 2:29 PM.

Details

Summary

Modify ifname_linux_to_bsd() to properly work with Linux loopback
interface (for future use in linsysfs).

Allow NULL bsdname to aviod excess strlcpy if bsdname is not needed
by the caller.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

dchagin created this revision.May 2 2019, 2:29 PM
emaste added a subscriber: emaste.May 3 2019, 9:13 PM
emaste added inline comments.
sys/compat/linux/linux.c
239 ↗(On Diff #56961)

especially now that is_lo is bool I think the ?: operator is unnecessary obfuscation

dchagin updated this revision to Diff 57020.May 3 2019, 9:28 PM
dchagin retitled this revision from odify ifname_linux_to_bsd() to properly work with Linux loopback interface to Modify ifname_linux_to_bsd() to properly work with Linux loopback interface.
dchagin marked an inline comment as done.
dchagin added inline comments.
sys/compat/linux/linux.c
239 ↗(On Diff #56961)

Yes, indeed, thank you:)

emaste accepted this revision.May 6 2019, 6:26 PM

LGTM

sys/compat/linux/linux.c
234 ↗(On Diff #57020)

lxname[len] == '\0' would be more correct?

This revision is now accepted and ready to land.May 6 2019, 6:26 PM
This revision was automatically updated to reflect the committed changes.
dchagin marked an inline comment as done.