]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - config/outgoingfw/outgoingfw.pl
Be a little more robust.
[people/pmueller/ipfire-2.x.git] / config / outgoingfw / outgoingfw.pl
index b323c380479ab9ec1501bae75a3a8e6296dd82ec..8d4d27d313136ab2ae486a50dece740d4f54b9ab 100644 (file)
@@ -2,7 +2,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2005-2010  IPTifre Team                                       #
+# Copyright (C) 2005-2010  IPFire Team                                        #
 #                                                                             #
 # This program is free software: you can redistribute it and/or modify        #
 # it under the terms of the GNU General Public License as published by        #
@@ -153,17 +153,18 @@ foreach $configentry (sort @configs)
                } elsif ($configline[2] eq 'ip') {
                        @SOURCE = ("$configline[5]");
                        $DEV = "";
-               } elsif ($configline[2] eq 'all') {
-                       @SOURCE = ("0/0");
-                       $DEV = "";
                } elsif ($configline[2] eq 'mac') {
                        @SOURCE = ("$configline[6]");
                        $DEV = "";
+               } elsif ($configline[2] eq 'all') {
+                       @SOURCE = ("0/0");
+                       $DEV = "";
                } else {
                        if ( -e "/var/ipfire/outgoing/groups/ipgroups/$configline[2]" ) {
                                @SOURCE = `cat /var/ipfire/outgoing/groups/ipgroups/$configline[2]`;
                        } elsif ( -e "/var/ipfire/outgoing/groups/macgroups/$configline[2]" ) {
                                @SOURCE = `cat /var/ipfire/outgoing/groups/macgroups/$configline[2]`;
+                               $configline[2] = "mac";
                        }
                        $DEV = "";
                }
@@ -188,7 +189,7 @@ foreach $configentry (sort @configs)
 
                                if ( $SOURCE eq "" ){next;}
 
-                               if ( $configline[6] ne "" ){
+                               if ( ( $configline[6] ne "" || $configline[2] eq 'mac' ) && $configline[2] ne 'all'){
                                        $SOURCE =~ s/[^a-zA-Z0-9]/:/gi;
                                        $CMD = "/sbin/iptables -A OUTGOINGFWMAC -m mac --mac-source $SOURCE -d $DESTINATION -p $PROTO";
                                } else {