Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Nov 2017 09:29:02 +0000 (UTC)
From:      Eugene Grosbein <eugen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r325798 - in stable/11: etc share/man/man5
Message-ID:  <201711140929.vAE9T200051242@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eugen
Date: Tue Nov 14 09:29:02 2017
New Revision: 325798
URL: https://svnweb.freebsd.org/changeset/base/325798

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/11/etc/network.subr
  stable/11/share/man/man5/rc.conf.5
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/network.subr
==============================================================================
--- stable/11/etc/network.subr	Tue Nov 14 07:04:06 2017	(r325797)
+++ stable/11/etc/network.subr	Tue Nov 14 09:29:02 2017	(r325798)
@@ -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.
@@ -213,6 +213,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

Modified: stable/11/share/man/man5/rc.conf.5
==============================================================================
--- stable/11/share/man/man5/rc.conf.5	Tue Nov 14 07:04:06 2017	(r325797)
+++ stable/11/share/man/man5/rc.conf.5	Tue Nov 14 09:29:02 2017	(r325798)
@@ -1578,6 +1578,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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711140929.vAE9T200051242>