[DragonFlyBSD - Bug #3306] Add description support for ifconfig(8)

bugtracker-admin at leaf.dragonflybsd.org bugtracker-admin at leaf.dragonflybsd.org
Mon Nov 15 02:08:18 PST 2021


Issue #3306 has been updated by liweitianux.

File 01-if-descr.aly.diff added

Hi tuxillo.  Thank you for the work.

I've reviewed the patch and tweaked it a bit.  Attached is the new patch, and you can diff to see the difference.

The main change is to the description ioctl(SIOCGIFDESCR) and print part.  According to the manpage and actual implementation, if the supplied buffer is too small, then ioctl(SIOCGIFDESCR) returns an error.  It looks to me the code in ifconfig.c is having issues.  I fixed it (but not yet tested).

Another minor issue is that I'm not sure returning ENOMSG is a good choice.  This errno is seldomly used, and I think that case is just normal (no description set), so it's fine to just return 0.

Cheers,
Aaron

----------------------------------------
Bug #3306: Add description support for ifconfig(8)
http://bugs.dragonflybsd.org/issues/3306#change-14193

* Author: tuxillo
* Status: In Progress
* Priority: Normal
* Category: Userland
* Target version: 6.2
* Start date: 2021-11-12
----------------------------------------


Is there a chance the 'ifconfig NIC description XXX' functionality
will sync with the FreeBSD ? This is a fairly popular option.

<pre>
# ifconfig vlan1 description vm1-vlan
ifconfig: description: bad value
</pre>

OpenBSD also has a similar capability[1], as NetBSD as well[2]

Thanks!
__

fn1. https://man.openbsd.org/ifconfig.8

fn2. https://man.netbsd.org/ifconfig.8


---Files--------------------------------
01-if-descr.patch (11.7 KB)
01-if-descr.aly.diff (11.8 KB)


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account



More information about the Bugs mailing list