svn commit: r325799 - in stable/10: etc share/man/man5

Eugene Grosbein eugen at FreeBSD.org
Tue Nov 14 09:31:58 UTC 2017


Author: eugen
Date: Tue Nov 14 09:31:56 2017
New Revision: 325799
URL: https://svnweb.freebsd.org/changeset/base/325799

Log:
  MFC r325559: ifconfig_<interface>_descr
  
  Add suitable knob ifconfig_<interface>_descr for static interface description.
  Document availability of interface descriptions within rc.conf(5).
  
  Approved by:	avg (mentor)

Modified:
  stable/10/etc/network.subr
  stable/10/share/man/man5/rc.conf.5
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/etc/network.subr
==============================================================================
--- stable/10/etc/network.subr	Tue Nov 14 09:29:02 2017	(r325798)
+++ stable/10/etc/network.subr	Tue Nov 14 09:31:56 2017	(r325799)
@@ -124,7 +124,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.
@@ -216,8 +216,9 @@ ifconfig_up()
 	ifalias $1 link alias
 	ifalias $1 ether alias
 
-	if [ ${_cfg} -eq 0 ]; then
-		${IFCONFIG_CMD} $1 up
+	_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

Modified: stable/10/share/man/man5/rc.conf.5
==============================================================================
--- stable/10/share/man/man5/rc.conf.5	Tue Nov 14 09:29:02 2017	(r325798)
+++ stable/10/share/man/man5/rc.conf.5	Tue Nov 14 09:31:56 2017	(r325799)
@@ -1575,6 +1575,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


More information about the svn-src-stable-10 mailing list