Fix IPv6 address validation error

This commit is contained in:
Tom Eastep 2009-10-23 13:41:51 -07:00
parent 46896e7dce
commit 86df82a29a
5 changed files with 13 additions and 3 deletions

View File

@ -100,7 +100,7 @@ sub generate_script_1() {
EOF EOF
copy1 $lib; copy1 $lib;
emit "/n"; emit "\n";
} }
emit <<'EOF'; emit <<'EOF';

View File

@ -476,6 +476,7 @@ sub valid_6address( $ ) {
return 0 unless valid_4address pop @address; return 0 unless valid_4address pop @address;
$max = 6; $max = 6;
$address = join ':', @address; $address = join ':', @address;
return 1 if @address eq ':';
} else { } else {
$max = 8; $max = 8;
} }

View File

@ -143,10 +143,12 @@ sub setup_route_marking() {
sub copy_table( $$$ ) { sub copy_table( $$$ ) {
my ( $duplicate, $number, $realm ) = @_; my ( $duplicate, $number, $realm ) = @_;
my $filter = $family == F_IPV6 ? q(sed 's/ via :: / /' | ) : '';
if ( $realm ) { if ( $realm ) {
emit ( "\$IP -$family route show table $duplicate | sed -r 's/ realm [[:alnum:]_]+//' | while read net route; do" ) emit ( "\$IP -$family route show table $duplicate | sed -r 's/ realm [[:alnum:]_]+//' | while read net route; do" )
} else { } else {
emit ( "\$IP -$family route show table $duplicate | while read net route; do" ) emit ( "\$IP -$family route show table $duplicate | ${filter}while read net route; do" )
} }
emit ( ' case $net in', emit ( ' case $net in',
@ -163,10 +165,12 @@ sub copy_table( $$$ ) {
sub copy_and_edit_table( $$$$ ) { sub copy_and_edit_table( $$$$ ) {
my ( $duplicate, $number, $copy, $realm) = @_; my ( $duplicate, $number, $copy, $realm) = @_;
my $filter = $family == F_IPV6 ? q(sed 's/ via :: / /' | ) : '';
if ( $realm ) { if ( $realm ) {
emit ( "\$IP -$family route show table $duplicate | sed -r 's/ realm [[:alnum:]_]+//' | while read net route; do" ) emit ( "\$IP -$family route show table $duplicate | sed -r 's/ realm [[:alnum:]_]+//' | while read net route; do" )
} else { } else {
emit ( "\$IP -$family route show table $duplicate | while read net route; do" ) emit ( "\$IP -$family route show table $duplicate | ${filter}while read net route; do" )
} }
emit ( ' case $net in', emit ( ' case $net in',

View File

@ -20,6 +20,8 @@ Changes in Shorewall 4.4.3
10) Add TRACK_PROVIDERS option. 10) Add TRACK_PROVIDERS option.
11) Fix IPv6 address parsing bug.
Changes in Shorewall 4.4.2 Changes in Shorewall 4.4.2
1) BUGFIX: Correct detection of Persistent SNAT support 1) BUGFIX: Correct detection of Persistent SNAT support

View File

@ -194,6 +194,9 @@ Shorewall 4.4.3
interface (name ends with +) in /etc/shorewall/interfaces did interface (name ends with +) in /etc/shorewall/interfaces did
not work correctly in all cases. not work correctly in all cases.
5) IPv4 addresses embedded in IPv6 (e.g., ::192.168.1.5) were
incorrectly reported as invalid.
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
K N O W N P R O B L E M S R E M A I N I N G K N O W N P R O B L E M S R E M A I N I N G
---------------------------------------------------------------------------- ----------------------------------------------------------------------------