Clean up ALL_ACASTS generation

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2020-09-10 15:59:33 -07:00
parent 2166251b97
commit 63b477a4de
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10

View File

@ -1375,7 +1375,7 @@ sub process_interface( $$ ) {
$hostoptions{$option} = $value if $hostopt; $hostoptions{$option} = $value if $hostopt;
} elsif ( $type == ENUM_IF_OPTION ) { } elsif ( $type == ENUM_IF_OPTION ) {
if ( $option eq 'arp_ignore' ) { if ( $option eq 'arp_ignore' ) {
fatal_error q(The 'arp_ignore' option may not be used with a wild-card interface name) if $wildcard; fatal_error q(The 'arp_ignore' option may not be used with a wild-card interface name) if $physwild;
if ( defined $value ) { if ( defined $value ) {
if ( $value =~ /^[1-3,8]$/ ) { if ( $value =~ /^[1-3,8]$/ ) {
$options{arp_ignore} = $value; $options{arp_ignore} = $value;
@ -2402,7 +2402,10 @@ sub generate_all_acasts() {
my $interfaceref = $interfaces{$interface}; my $interfaceref = $interfaces{$interface};
my $physical = $interfaceref->{physical}; my $physical = $interfaceref->{physical};
if ( $interfaceref->{wildcard} ) { next if ( $interfaceref->{options}{port} ||
$interfaceref->{options}{unmanaged} );
if ( $interfaceref->{physwild} ) {
$physical =~ s/\+/*/; $physical =~ s/\+/*/;
if ( $interfaceref->{options}{omitanycast} ) { if ( $interfaceref->{options}{omitanycast} ) {
@ -2469,10 +2472,12 @@ sub generate_all_acasts() {
emit( join( '|', @wildnoacasts) . ')', emit( join( '|', @wildnoacasts) . ')',
' ;;' ); ' ;;' );
} else { } else {
@wildacasts = ( '*' ); @wildacasts = ( '*' );
} }
if ( @wildacasts ) {
emit( join( '|', @wildacasts ) . ')', emit( join( '|', @wildacasts ) . ')',
' if [ -n "$ALL_ACASTS" ]; then', ' if [ -n "$ALL_ACASTS" ]; then',
' ALL_ACASTS="$ALL_ACASTS $(get_interface_acasts $iface)"', ' ALL_ACASTS="$ALL_ACASTS $(get_interface_acasts $iface)"',
@ -2480,6 +2485,7 @@ sub generate_all_acasts() {
' ALL_ACASTS="$(get_interface_acasts $iface)"', ' ALL_ACASTS="$(get_interface_acasts $iface)"',
' fi', ' fi',
' ;;' ); ' ;;' );
}
pop_indent; pop_indent;
emit( 'esac'); emit( 'esac');