From e4c2fc3046400a4aacfe4b75983f17553e2f8aba Mon Sep 17 00:00:00 2001 From: hrs Date: Sun, 30 Jun 2013 19:52:45 +0000 Subject: Add "ether" and "link" to ifconfig_alias{es,N}. --- etc/network.subr | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'etc') diff --git a/etc/network.subr b/etc/network.subr index 44894c9..c6b8585 100644 --- a/etc/network.subr +++ b/etc/network.subr @@ -164,6 +164,9 @@ ifconfig_up() fi fi + ifalias $1 link alias + ifalias $1 ether alias + if [ ${_cfg} -eq 0 ]; then ${IFCONFIG_CMD} $1 up fi @@ -432,6 +435,9 @@ afexists() return 1 fi ;; + link|ether) + return 0 + ;; *) err 1 "afexists(): Unsupported address family: $_af" ;; @@ -700,7 +706,7 @@ ifalias() afexists $2 || return $_ret case "$2" in - inet|inet6) + inet|inet6|link|ether) ifalias_af_common $1 $2 $3 && _ret=0 ;; esac @@ -907,6 +913,11 @@ ifalias_af_common_handler() *) return ;; esac + # link(ether) does not support address removal. + case $_af:$_action in + link:-alias|ether:-alias) return ;; + esac + _tmpargs= for _c in $_args; do case $_c in @@ -965,6 +976,8 @@ ifalias_af_common() inet\ *) _iaf=inet ;; inet6\ *) _iaf=inet6 ;; ipx\ *) _iaf=ipx ;; + link\ *) _iaf=link ;; + ether\ *) _iaf=ether ;; esac case ${_af}:${_action}:${_iaf}:"${ifconfig_args}" in @@ -1012,7 +1025,7 @@ ifalias_af_common() _tmpargs= for _c in `get_if_var $_if ifconfig_IF_aliases` $_aliasn; do case $_c in - inet|inet6|ipx) + inet|inet6|ipx|link|ether) case $_tmpargs in ${_af}\ *) eval ifalias_af_common_handler $_if $_af $_action $_tmpargs && _ret=0 -- cgit v1.1