Index: etc/network.subr =================================================================== --- etc/network.subr (revision 215423) +++ etc/network.subr (working copy) @@ -47,6 +47,7 @@ ipv4_up ${ifn} && cfg=0 ipv6_up ${ifn} && cfg=0 ipx_up ${ifn} && cfg=0 + ifdescr_up ${ifn} && cfg=0 childif_create ${ifn} && cfg=0 return $cfg @@ -69,6 +70,7 @@ ipv4_down ${ifn} && cfg=0 ifconfig_down ${ifn} && cfg=0 ifscript_down ${ifn} && cfg=0 + ifdescr_down ${ifn} && cfg=0 childif_destroy ${ifn} && cfg=0 return $cfg @@ -1214,6 +1216,35 @@ return 0 } +# ifdescr_up if +# Add description to the interface $if. +# +ifdescr_up() +{ + local _if _ifdescr + + _if=$1 + _ifdescr="`get_if_var $_if ifconfig_IF_descr`" + if [ ! -z "$_ifdescr" ]; then + ifconfig $_if descr "$_ifdescr" + fi + + return 0 +} + +# ifdescr_down if +# Remove description from the interface $if. +# +ifdescr_down() +{ + local _if _ifdescr + + _if=$1 + ifconfig $_if -descr + + return 0 +} + # list_net_interfaces type # List all network interfaces. The type of interface returned # can be controlled by the type argument. The type Index: etc/defaults/rc.conf =================================================================== --- etc/defaults/rc.conf (revision 215423) +++ etc/defaults/rc.conf (working copy) @@ -214,6 +214,7 @@ #ifconfig_ed0_ipv6="inet6 2001:db8:1::1 prefixlen 64" # Sample IPv6 addr entry #ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64" # Sample IPv6 alias #ifconfig_fxp0_name="net0" # Change interface name from fxp0 to net0. +#ifconfig_fxp0_descr="Uplink to Switch 2" # Label fxp0 interface #vlans_fxp0="101 vlan0" # vlan(4) interfaces for fxp0 device #create_args_vlan0="vlan 102" # vlan tag for vlan0 device #wlans_ath0="wlan0" # wlan(4) interfaces for ath0 device