Add suitable knob ifconfig_<interface>_descr for static interface description.

Document availability of interface descriptions within rc.conf(5).

Approved by:	avg (mentor), mav (mentor)
MFC after:	3 days
This commit is contained in:
Eugene Grosbein 2017-11-08 16:53:11 +00:00
parent b9a63e5c3a
commit cedc7c5870
2 changed files with 23 additions and 1 deletions

View File

@ -122,7 +122,7 @@ ifn_vnet0()
#
ifconfig_up()
{
local _cfg _ipv6_opts ifconfig_args
local _cfg _ifconfig_descr _ipv6_opts ifconfig_args
_cfg=1
# Make sure lo0 always comes up.
@ -214,6 +214,11 @@ ifconfig_up()
ifalias $1 link alias
ifalias $1 ether alias
_ifconfig_descr=`get_if_var $1 ifconfig_IF_descr`
if [ -n "${_ifconfig_descr}" ]; then
${IFCONFIG_CMD} $1 description "${_ifconfig_descr}"
fi
if wpaif $1; then
/etc/rc.d/wpa_supplicant start $1
_cfg=0 # XXX: not sure this should count

View File

@ -1616,6 +1616,23 @@ is set to 1.
.Pp
Default is
.Dq Li NO .
.It Va ifconfig_ Ns Ao Ar interface Ac Ns _descr
.Pq Vt str
This assigns arbitrary description to an interface.
The
.Xr sysctl 8
variable
.Va net.ifdescr_maxlen
limits its length.
This static setting may be overridden by commands
started with dynamic interface configuration utilities
like
.Xr dhclient 8
hooks. The description can be seen with
.Xr ifconfig 8
command and it may be exported with
.Xr bsnmpd 1
daemon using its MIB-2 module.
.It Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6
.Pq Vt str
IPv6 functionality on an interface should be configured by