Page MenuHomeFreeBSD

ifconfig: Add netlink helper to create interface
Needs ReviewPublic

Authored by pouria on Sun, Feb 8, 9:41 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Feb 13, 11:13 AM
Unknown Object (File)
Wed, Feb 11, 8:57 AM
Unknown Object (File)
Wed, Feb 11, 5:21 AM
Unknown Object (File)
Wed, Feb 11, 4:41 AM
Unknown Object (File)
Wed, Feb 11, 4:39 AM
Unknown Object (File)
Wed, Feb 11, 3:40 AM
Subscribers

Details

Reviewers
glebius
zlei
markj
Group Reviewers
network
Summary

Add a helper function for netlink to
be easier to create interfaces directly using netlink.
While here, fix style issue of a line above it.

Test Plan

will be used in ifconfig_geneve and
future netlink implementations in ifconfig.

Diff Detail

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

Event Timeline

pouria requested review of this revision.Sun, Feb 8, 9:41 AM
glebius added inline comments.
sbin/ifconfig/ifconfig_netlink.c
507–510

IMHO, we should errx() even if error_str is NULL.

This revision is now accepted and ready to land.Thu, Feb 12, 12:01 AM

Also (NETLINK) isn't a great error message at all. Please try grep errx sbin/ifconfig/*.c to check other error messages. Maybe just only contents of errmsg.error_str in the case it was provided and unknown error from netlink(4) in case it was not?

This revision now requires review to proceed.Thu, Feb 12, 9:36 AM

After running my tests for this change, I remembered that
the netlink can reply with an NLMSG_ERROR containing error = 0.
That's why I didn't call errx() when error_str==NULL.

However, I've fixed the error message as you recommendeded. @glebius

After running my tests for this change, I remembered that
the netlink can reply with an NLMSG_ERROR containing error = 0.

That's real strange. Do you know how to reproduce that?