On Fri, 2011-09-16 at 12:55 +0300, Kostas Kavourakis wrote:
> Hi, I stumbled upon a problem with that manifests itself starting from 
> Shorewall version 4.4.23 and higher (tried already 4.4.23.1 and 4.4.23.2).
> 
> If I set "TC_Enabled=Shared" in Shorewall6's shorewall.conf, it fails to 
> start with the following output:
> 
...
> Shorewall configuration compiled to /var/lib/shorewall6/.start
> /var/lib/shorewall6/.start: line 1592: syntax error near unexpected 
> token `else'
> /var/lib/shorewall6/.start: line 1592: `else'
> /var/lib/shorewall6/.start: line 1592: syntax error near unexpected 
> token `else'
> /var/lib/shorewall6/.start: line 1592: `else'
> -------------------------------------------------------------------
> 
> At line 1592 of the .start file I see these:
> 
> 
> --------------------------------------------------------------------
>     progress_message2 Setting up Proxy NDP...
> 
>      return 0
> }
> 
> #
> # Configure Traffic Shaping for ppp0
> #
> setup_ppp0_tc() {
> 
>      progress_message "   TC Device ppp0 defined."
> else
>      error_message "WARNING: Device ppp0 is not in the UP state -- 
> traffic-shaping configuration ski$
>      ppp0_exists=
> fi

Shorewall 4.4.23 definitely broke TC_ENABLED=Shared.

Please try the attached patch:

        patch /usr/share/shorewall/Shorewall/Tc.pm < SHARED.patch

and let us know if it solved your problem.

Thanks,
-Tom
-- 
Tom Eastep        \ When I die, I want to go like my Grandfather who
Shoreline,         \ died peacefully in his sleep. Not screaming like
Washington, USA     \ all of the passengers in his car
http://shorewall.net \________________________________________________

diff --git a/Shorewall/Perl/Shorewall/Tc.pm b/Shorewall/Perl/Shorewall/Tc.pm
index d80ef17..84b589f 100644
--- a/Shorewall/Perl/Shorewall/Tc.pm
+++ b/Shorewall/Perl/Shorewall/Tc.pm
@@ -1456,17 +1456,17 @@ sub process_traffic_shaping() {
 
 	$device = physical_name $device;
 
-	my $dev = chain_base( $device );
+	unless ( $config{TC_ENABLED} eq 'Shared' ) {
 
-	emit( '',
-	      '#',
-	      "# Configure Traffic Shaping for $device",
-	      '#',
-	      "setup_${dev}_tc() {" );
+	    my $dev = chain_base( $device );
 
-	push_indent;
+	    emit( '',
+		  '#',
+		  "# Configure Traffic Shaping for $device",
+		  '#',
+		  "setup_${dev}_tc() {" );
 
-	unless ( $config{TC_ENABLED} eq 'Shared' ) {
+	    push_indent;
 
 	    emit "if interface_is_up $device; then";
 
@@ -1589,25 +1589,25 @@ sub process_traffic_shaping() {
 		emit '';
 
 	    }
-	}
 
-	emit '';
+	    emit '';
 
-	emit "$_" for @{$devref->{filters}};
+	    emit "$_" for @{$devref->{filters}};
 	
-	save_progress_message_short qq("   TC Device $device defined.");
+	    save_progress_message_short qq("   TC Device $device defined.");
 
-	pop_indent;
-	emit 'else';
-	push_indent;
+	    pop_indent;
+	    emit 'else';
+	    push_indent;
 
-	emit qq(error_message "WARNING: Device $device is not in the UP state -- traffic-shaping configuration skipped");
-	emit "${dev}_exists=";
-	pop_indent;
-	emit "fi\n";
+	    emit qq(error_message "WARNING: Device $device is not in the UP state -- traffic-shaping configuration skipped");
+	    emit "${dev}_exists=";
+	    pop_indent;
+	    emit "fi\n";
 
-	pop_indent;
-	emit "}\n";
+	    pop_indent;
+	    emit "}\n";
+	}
     }
 }
 
@@ -1625,7 +1625,9 @@ sub process_tc() {
     # it can call the appropriate 'setup_x_tc" function when the device is
     # enabled.
 
-    \%tcdevices;
+    my %empty;
+    
+    $config{TC_ENABLED} eq 'Shared' ? \%empty : \%tcdevices;
 }
 
 #
@@ -1640,7 +1642,6 @@ sub setup_traffic_shaping() {
 
 	emit "setup_${dev}_tc";
     }
-
 }
 
 #
@@ -1756,7 +1757,7 @@ sub setup_tc() {
 	append_file $globals{TC_SCRIPT};
     } else {
 	process_tcpri if $config{TC_ENABLED} eq 'Simple';
-	setup_traffic_shaping;
+	setup_traffic_shaping unless $config{TC_ENABLED} eq 'Shared';
     }
 
     if ( $config{TC_ENABLED} ) {

Attachment: signature.asc
Description: This is a digitally signed message part

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
http://p.sf.net/sfu/rim-devcon-copy2
_______________________________________________
Shorewall-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-users

Reply via email to