Date: Thu, 18 Jul 2013 02:58:25 +0000 (UTC) From: Hiroki Sato <hrs@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253444 - head/etc Message-ID: <201307180258.r6I2wPNe040140@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hrs Date: Thu Jul 18 02:58:24 2013 New Revision: 253444 URL: http://svnweb.freebsd.org/changeset/base/253444 Log: - Fix a bug in ipv6_prefix_IF. It did not work with the 64-bit prefix notation like 2001:db8:1:1. - Use eui64 flag in ifconfig(8) instead of network6_getladdr()[*] for interface indentifier part. Suggested by: ume [*] MFC after: 3 days Modified: head/etc/network.subr Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Thu Jul 18 02:34:25 2013 (r253443) +++ head/etc/network.subr Thu Jul 18 02:58:24 2013 (r253444) @@ -1052,16 +1052,12 @@ ifalias_af_common() # ipv6_prefix_hostid_addr_common() { - local _if _action prefix laddr hostid j address + local _if _action prefix j _if=$1 _action=$2 prefix=`get_if_var ${_if} ipv6_prefix_IF` if [ -n "${prefix}" ]; then - laddr=`network6_getladdr ${_if}` - hostid=${laddr#fe80::} - hostid=${hostid%\%*} - for j in ${prefix}; do # The default prefixlen is 64. plen=${j#*/} @@ -1071,18 +1067,10 @@ ipv6_prefix_hostid_addr_common() esac # Normalize the last part by removing ":" - j=${j%:*} + j=${j%::*} j=${j%:} - OIFS=$IFS; IFS=":"; set -- $j; nj=$#; IFS=$OIFS - OIFS=$IFS; IFS=":"; set -- $hostid; nh=$#; IFS=$OIFS - if [ $(($nj + $nh)) -eq 8 ]; then - address=$j\:$hostid - else - address=$j\::$hostid - fi - - ${IFCONFIG_CMD} ${_if} inet6 ${address} \ - prefixlen $plen ${_action} + ${IFCONFIG_CMD} ${_if} inet6 $j:: \ + prefixlen $plen eui64 ${_action} # if I am a router, add subnet router # anycast address (RFC 2373).
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307180258.r6I2wPNe040140>