]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - config/guardian/guardian.pl
Fixed guardian ignore file handling and linefead detection.
[people/pmueller/ipfire-2.x.git] / config / guardian / guardian.pl
index 5c421868b9bebb25faab1044541dfee9f206462a..8c2e3b7046e98a3094bd1f28e8a7908dbbd7c866 100644 (file)
@@ -34,12 +34,13 @@ if ($hostipaddr !~ /\d+\.\d+\.\d+\.\d+/) {
 
 $networkaddr = $hostipaddr;
 $networkaddr =~ s/\d+$/0/;
-$gatewayaddr = $hostipaddr;
-$gatewayaddr =~ s/\d+$/$hostgatewaybyte/;
+$gatewayaddr = `cat /var/ipfire/red/remote-ipaddress 2>/dev/null`;
 $broadcastaddr = $hostipaddr;
 $broadcastaddr =~ s/\d+$/255/;
 &build_ignore_hash;
 
+print "My gatewayaddess is: $gatewayaddr\n";
+
 # This is the target hash. If a packet was destened to any of these, then the
 # sender of that packet will get denied, unless it is on the ignore list..
 
@@ -210,7 +211,8 @@ sub build_ignore_hash {
        if ($ignorefile ne "") {
                open (IGNORE, $ignorefile);
                while (<IGNORE>) {
-                       chop;
+                       $_=~ s/\s+$//;
+                       chomp;
                        next if (/\#/);  #skip comments
                        next if (/^\s*$/); # and blank lines
                        $ignore{$_}=1;