Correct anycast address generation -- Take 2

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@9044 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2008-12-14 04:18:54 +00:00
parent 0432332380
commit 3272f6797e

View File

@ -555,6 +555,13 @@ normalize_address() # $1 = valid IPv6 Address
done
}
#
# Reads correctly-formed and fully-qualified host and subnet addresses from STDIN. For each
# that defines a /120 or larger network, it sends to STDOUT:
#
# The corresponding subnet-router anycast address (all host address bits are zero)
# The corresponding anycast addresses defined by RFC 2526 (the last 128 addresses in the subnet)
#
convert_to_anycast() {
local address
local badress
@ -615,16 +622,16 @@ convert_to_anycast() {
else
badress=$address
fi
#
# Note: at this point $address and $badress are the same except possibly for
# the contents of the last half-word
#
list_count $(split $address)
l=$?
#
# Now generate the anycast addresses defined by RFC 2526
#
# Note: at this point $address and $badress are the same except possibly for
# the contents of the last half-word
#
if [ $l -lt 8 ]; then
#
# The subnet-router address