Author: eugen
Date: Wed Nov  8 16:53:11 2017
New Revision: 325559
URL: https://svnweb.freebsd.org/changeset/base/325559

Log:
  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

Modified:
  head/etc/network.subr
  head/share/man/man5/rc.conf.5

Modified: head/etc/network.subr
==============================================================================
--- head/etc/network.subr       Wed Nov  8 16:45:53 2017        (r325558)
+++ head/etc/network.subr       Wed Nov  8 16:53:11 2017        (r325559)
@@ -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: head/share/man/man5/rc.conf.5
==============================================================================
--- head/share/man/man5/rc.conf.5       Wed Nov  8 16:45:53 2017        
(r325558)
+++ head/share/man/man5/rc.conf.5       Wed Nov  8 16:53:11 2017        
(r325559)
@@ -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
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to