Correct physical naming and bridges

This commit is contained in:
Tom Eastep 2011-04-03 13:23:20 -07:00
parent 72aa24062c
commit 438d2a838e

View File

@ -2657,7 +2657,9 @@ sub match_source_dev( $ ) {
$interface = $interfaceref->{physical} if $interfaceref; $interface = $interfaceref->{physical} if $interfaceref;
return '' if $interface eq '+'; return '' if $interface eq '+';
if ( $interfaceref && $interfaceref->{options}{port} ) { if ( $interfaceref && $interfaceref->{options}{port} ) {
"-i $interfaceref->{bridge} -m physdev --physdev-in $interface "; my $bridgeref = find_interface $interfaceref->{bridge};
"-i $bridgeref->{physical} -m physdev --physdev-in $interface ";
} else { } else {
"-i $interface "; "-i $interface ";
} }
@ -2672,10 +2674,12 @@ sub match_dest_dev( $ ) {
$interface = $interfaceref->{physical} if $interfaceref; $interface = $interfaceref->{physical} if $interfaceref;
return '' if $interface eq '+'; return '' if $interface eq '+';
if ( $interfaceref && $interfaceref->{options}{port} ) { if ( $interfaceref && $interfaceref->{options}{port} ) {
my $bridgeref = find_interface $interfaceref->{bridge};
if ( have_capability( 'PHYSDEV_BRIDGE' ) ) { if ( have_capability( 'PHYSDEV_BRIDGE' ) ) {
"-o $interfaceref->{bridge} -m physdev --physdev-is-bridged --physdev-out $interface "; "-o $bridgeref->{physical} -m physdev --physdev-is-bridged --physdev-out $interface ";
} else { } else {
"-o $interfaceref->{bridge} -m physdev --physdev-out $interface "; "-o $bridgeref->{physical} -m physdev --physdev-out $interface ";
} }
} else { } else {
"-o $interface "; "-o $interface ";