Clean up 'upnpclient' implementation

This commit is contained in:
Tom Eastep 2009-06-16 09:43:22 -07:00
parent a43431af57
commit 58b2488459
4 changed files with 28 additions and 16 deletions

View File

@ -768,7 +768,9 @@ sub use_input_chain($) {
my $interfaceref = find_interface($interface);
my $nets = $interfaceref->{nets};
#
# We must use the interfaces's chain if the interface is associated with multiple zone nets
# We must use the interfaces's chain if the interface is associated with multiple zone nets or
# if the interface has the 'upnpclient' option. In the latter case, the chain's rules will contain
# run-time code which currently cannot be transferred to a zone-oriented chain by move_rules().
#
return 1 if $nets > 1 || $interfaceref->{options}{upnpclient};
#

View File

@ -262,22 +262,18 @@ sub generate_script_2() {
emit ( 'esac' ) ,
}
unless ( $providers ) {
my $interfaces = find_interfaces_by_option 'optional';
my $interfaces = find_interfaces_by_option 'optional';
if ( $interfaces ) {
emit '';
if ( $interfaces ) {
emit '';
my $first = 1;
for my $interface ( @$interfaces ) {
my $first = 1;
for my $interface ( @$interfaces ) {
unless ( is_provider_interface $interface ) {
my $base = uc chain_base( $interface );
if ( $first ) {
$first = 0;
} else {
emit '';
}
$first and $first = 0 or emit '';
emit ( "if interface_is_usable $interface; then" ,
" ${base}_IS_UP=Yes" ,

View File

@ -33,7 +33,7 @@ use Shorewall::Chains qw(:DEFAULT :internal);
use strict;
our @ISA = qw(Exporter);
our @EXPORT = qw( setup_providers @routemarked_interfaces handle_stickiness $providers );
our @EXPORT = qw( setup_providers @routemarked_interfaces handle_stickiness is_provider_interface );
our @EXPORT_OK = qw( initialize lookup_provider );
our $VERSION = '4.3_7';
@ -56,7 +56,7 @@ our %providers;
our @providers;
our $providers;
our %provider_interfaces;
our $family;
@ -75,6 +75,7 @@ sub initialize( $ ) {
@routemarked_providers = ();
%routemarked_interfaces = ();
@routemarked_interfaces = ();
%provider_interfaces = ();
$balancing = 0;
$fallback = 0;
$first_default_route = 1;
@ -265,6 +266,9 @@ sub add_a_provider( ) {
}
fatal_error "Unknown Interface ($interface)" unless known_interface $interface;
fatal_error "Duplicate Provider Interface ($interface)" if $provider_interfaces{$interface};
$provider_interfaces{$interface} = 1;
my $provider = chain_base $table;
my $base = uc chain_base $interface;
@ -748,7 +752,7 @@ sub test_optional_providers() {
}
sub setup_providers() {
$providers = 0;
my $providers = 0;
my $fn = open_file 'providers';
@ -823,6 +827,10 @@ sub lookup_provider( $ ) {
$providerref->{shared} ? $providerref->{number} : 0;
}
sub is_provider_interface( $ ) {
return $provider_interfaces{$_[0]} || 0;
}
#
# The Tc module has collected the 'sticky' rules in the 'tcpre' and 'tcout' chains. In this function, we apply them
# to the 'tracked' providers

View File

@ -106,6 +106,9 @@ Shorewall 4.4.0 Beta 2
want your configuration backed up prior to upgradeing, you will
need to do that yourself.
As part of this change, the fallback.sh scripts are no longer
released.
----------------------------------------------------------------------------
P R O B L E M S C O R R E C T E D I N 4 . 4 . 0 Beta 2
----------------------------------------------------------------------------
@ -120,6 +123,9 @@ Shorewall 4.4.0 Beta 2
ERROR: Command "tc qdisc add dev dsl0 root handle 1: htb
default 0 r2q 5.5" Failed
3) The help output from the install.sh scripts mentioned the '-n'
option but support for that option has been removed.
----------------------------------------------------------------------------
K N O W N P R O B L E M S R E M A I N I N G
----------------------------------------------------------------------------