From owner-svn-src-stable-10@freebsd.org Tue Nov 14 09:31:58 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F1A1DB942C; Tue, 14 Nov 2017 09:31:58 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B60AD7707F; Tue, 14 Nov 2017 09:31:57 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAE9VuEQ054463; Tue, 14 Nov 2017 09:31:56 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAE9VuWE054461; Tue, 14 Nov 2017 09:31:56 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201711140931.vAE9VuWE054461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Tue, 14 Nov 2017 09:31:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r325799 - in stable/10: etc share/man/man5 X-SVN-Group: stable-10 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: in stable/10: etc share/man/man5 X-SVN-Commit-Revision: 325799 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Nov 2017 09:31:58 -0000 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__descr Add suitable knob ifconfig__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