git: ifconfig(8): Do not wrongly use 'create' as hostname

Aaron LI aly at crater.dragonflybsd.org
Sun Apr 12 07:22:22 PDT 2020


commit 421c46af64c8b876df8356afa8a3af5fa977fdf1
Author: Aaron LI <aly at aaronly.me>
Date:   Sun Apr 12 22:12:14 2020 +0800

    ifconfig(8): Do not wrongly use 'create' as hostname
    
    Do not allow to use the 'create' keyword as a hostname when ifconfig(8)
    is invoked for an already existing interface.
    
    Without this commit, ifconfig(8) assumes the 'create' keyword as a
    hostname and tries to resolve it when 'ifconfig ifname create' invoked
    for an already existing interface.  This can produce some misleading
    error messages (e.g., 'create: bad value') or even unexpected results
    (e.g., when the hostname resolving succeeds).
    
    With this commit, when an interface is already exists and the 'create'
    is the only argument, return an error message.  But when there are some
    other arguments, just ignore the 'create' keyword and carry on.
    
    Obtained from FreeBSD:
    https://github.com/freebsd/freebsd/commit/e383c28ab5b8d0bdc15281e7522c368d56ac1a76
    https://reviews.freebsd.org/D17171

Summary of changes:
 sbin/ifconfig/ifconfig.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/421c46af64c8b876df8356afa8a3af5fa977fdf1


-- 
DragonFly BSD source repository


More information about the Commits mailing list