From: Paul M. <pau...@hp...> - 2011-03-13 19:39:17
|
your dog getting kicked apply.] Fix the IPv6 address calculations in the network tests' address filter functions. Signed-off-by: Paul Moore <pau...@hp...> --- audit/network/addr_filter.bash | 26 ++++---------------------- 1 files changed, 4 insertions(+), 22 deletions(-) diff --git a/audit/network/addr_filter.bash b/audit/network/addr_filter.bash index cc8cf40..04e6ad3 100755 --- a/audit/network/addr_filter.bash +++ b/audit/network/addr_filter.bash @@ -24,25 +24,9 @@ # helper functions # -function get_ipv6_prefix { - if [[ -n $LBLNET_SVR_IPV6 ]]; then - ip -f inet6 route show to match $LBLNET_SVR_IPV6 | \ - grep -v default | cut -d'/' -f 1 - elif [[ -n $LBLNET_PREFIX_IPV6 ]]; then - echo $LBLNET_PREFIX_IPV6 | sed 's/:\/[0-9]*//;s/:0*/:/g;' - else - ip -o -f inet6 addr show scope global | \ - awk 'BEGIN { FS = "[ \t]*|[ \t\\/]+" } { print $4 }' | \ - awk 'BEGIN { FS = ":" } { print $1":"$2":"$3":"$4":" }' | \ - head -n 1 - fi -} - function get_ipv6_iface { - declare prefix=$(get_ipv6_prefix) - ip -o -f inet6 addr show scope global | \ - awk 'BEGIN { FS = "[ \t]*|[ \t\\/]+" } { print $2 }' | \ - grep $prefix | head -n 1 + ip -o -f inet6 addr show scope global to $LBLNET_PREFIX_IPV6 | \ + head -n 1 | awk '{ print $2 }' } function get_ipv4_addr { @@ -51,10 +35,8 @@ function get_ipv4_addr { } function get_ipv6_addr { - declare prefix=$(get_ipv6_prefix) - ip -o -f inet6 addr show scope global | \ - awk 'BEGIN { FS = "[ \t]*|[ \t\\/]+" } { print $4 }' | \ - grep $prefix | head -n 1 + ip -o -f inet6 addr show scope global to $LBLNET_PREFIX_IPV6 | \ + head -n 1 | awk '{ print $4 }' } #### |