diff --git a/Shorewall-perl/Shorewall/Chains.pm b/Shorewall-perl/Shorewall/Chains.pm index 62ee4db21..649a193bc 100644 --- a/Shorewall-perl/Shorewall/Chains.pm +++ b/Shorewall-perl/Shorewall/Chains.pm @@ -1427,6 +1427,7 @@ sub match_source_net( $;$ ) { validate_range $addr1, $addr2; iprange_match . "${invert}--src-range $net "; } elsif ( $net =~ /^(!?)~(.*)$/ ) { + fatal_error "MAC address cannot be used in this context" if $restriction >= OUTPUT_RESTRICT; mac_match $net; } elsif ( $net =~ /^(!?)\+/ ) { require_capability( 'IPSET_MATCH' , 'ipset names in Shorewall configuration files' , '' ); diff --git a/Shorewall-perl/Shorewall/Tc.pm b/Shorewall-perl/Shorewall/Tc.pm index c7bec5bd9..ce7d827af 100644 --- a/Shorewall-perl/Shorewall/Tc.pm +++ b/Shorewall-perl/Shorewall/Tc.pm @@ -311,7 +311,7 @@ sub rate_to_kbit( $ ) { return $1 * 1000 if $rate =~ /^(\d+)mbit$/i; return $1 * 8000 if $rate =~ /^(\d+)mbps$/i; return $1 * 8 if $rate =~ /^(\d+)kbps$/i; - return $1 / 125 if $rate =~ /^(\d+)(bps)?$/; + return int($1/125) if $rate =~ /^(\d+)(bps)?$/; fatal_error "Invalid Rate ($rate)"; }