On 01/05/2013 04:44 AM, Steven Jan Springl wrote:

> In the attached config. arprule:
> 
> DROP  eth0:192.168.0.0/24  eth1  1
> 
> Produces the following error message:
> 
> Can't use string ("eth0") as a HASH ref while "strict refs" in use at 
> /usr/share/shorewall/Shorewall/ARP.pm line 144, <$currentfile> line 9.
> 
> Note, ARP.patch is applied but not ARP1.patch.

The attached patch corrects the problem and produces the expected error
message.

Thanks Steven,
-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/ARP.pm b/Shorewall/Perl/Shorewall/ARP.pm
index 5b041c0..a5eb7eb 100644
--- a/Shorewall/Perl/Shorewall/ARP.pm
+++ b/Shorewall/Perl/Shorewall/ARP.pm
@@ -88,7 +88,9 @@ sub process_arprule() {
     my ( $originalaction, $source, $dest, $opcode ) = split_line( 'arprules file entry', {action => 0, source => 1, dest => 2, opcode => 3 } );
 
     my $chainref;
+    my $iifaceref;
     my $iiface;
+    my $difaceref;
     my $diface;
     my $saddr;
     my $smac;
@@ -132,7 +134,7 @@ sub process_arprule() {
 
 	fatal_error "SOURCE interface missing" unless supplied $iiface; 
 
-	$iiface = find_interface( $iiface )->{physical};
+	$iiface = ( $iifaceref = find_interface( $iiface ) )->{physical};
 
 	fatal_error "Wildcard Interfaces ( $iiface )may not be used in this context" if $iiface =~ /\+$/;
 
@@ -146,13 +148,13 @@ sub process_arprule() {
 
 	fatal_error "DEST interface missing" unless supplied $diface; 
 
-	$diface = find_interface( $diface )->{physical};
+	$diface = ( $difaceref = find_interface( $diface ) )->{physical};
 
 	fatal_error "A wildcard interfaces ( $diface) may not be used in this context" if $diface =~ /\+$/;
 
 	if ( $iiface ) {
 	    fatal_error "When both SOURCE and DEST are given, the interfaces must be ports on the same bridge"
-		if $iiface->{bridge} ne $diface->{bridge};
+		if $iifaceref->{bridge} ne $difaceref->{bridge};
 	    $chainref = $arp_forward;
 	} else {
 	    $chainref = $arp_output;

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912
_______________________________________________
Shorewall-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-devel

Reply via email to