Page MenuHomeFreeBSD

Do not allow use `create` keyword as hostname when ifconfig(8) invoked for already existing interface
ClosedPublic

Authored by ae on Sep 14 2018, 10:40 AM.
Tags
None
Referenced Files
F137872700: D17171.id48045.diff
Wed, Nov 26, 5:12 PM
Unknown Object (File)
Mon, Nov 24, 3:24 AM
Unknown Object (File)
Sun, Nov 23, 9:22 AM
Unknown Object (File)
Fri, Nov 21, 12:46 AM
Unknown Object (File)
Fri, Nov 21, 12:36 AM
Unknown Object (File)
Fri, Nov 21, 12:35 AM
Unknown Object (File)
Fri, Nov 21, 12:30 AM
Unknown Object (File)
Wed, Nov 5, 3:27 PM
Subscribers

Details

Summary

It appeared, that ifconfig(8) assumes create keyword as hostname and tries to resolve it, when ifconfig ifname create invoked for already existing interface. This can produce some unexpected results, when hostname resolving successfully happened. This patch adds check for such case.
When an interface is already exists, and create is only one argument, return error message. But when there are some other arguments, just remove create keyword from the arguments list.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 19593
Build 19175: arc lint + arc unit

Event Timeline

ae added a reviewer: network.
This revision was not accepted when it landed; it landed in state Needs Review.Oct 21 2018, 2:40 PM
This revision was automatically updated to reflect the committed changes.
yuripv added inline comments.
head/sbin/ifconfig/ifconfig.c
515 ↗(On Diff #49394)

grammar nit: exists