From owner-svn-src-all@freebsd.org Wed Nov 8 16:53:13 2017 Return-Path: Delivered-To: svn-src-all@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 4DED0E5804F; Wed, 8 Nov 2017 16:53:13 +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 118CD1760; Wed, 8 Nov 2017 16:53:12 +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 vA8GrC3s067780; Wed, 8 Nov 2017 16:53:12 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8GrCPH067778; Wed, 8 Nov 2017 16:53:12 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201711081653.vA8GrCPH067778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Wed, 8 Nov 2017 16:53:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325559 - in head: etc share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: in head: etc share/man/man5 X-SVN-Commit-Revision: 325559 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 16:53:13 -0000 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__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