firewall: rules.pl: Catch invalid configurations.
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 21 Mar 2014 12:33:08 +0000 (13:33 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 21 Mar 2014 12:33:08 +0000 (13:33 +0100)
config/firewall/rules.pl

index d9c9b5c..a131c54 100755 (executable)
@@ -337,6 +337,11 @@ sub buildrules {
 
                                                        # Use iptables DNAT
                                                        } else {
 
                                                        # Use iptables DNAT
                                                        } else {
+                                                               if ($destination_is_firewall && !$destination) {
+                                                                       $destination = &fwlib::get_external_address();
+                                                               }
+                                                               next unless ($destination);
+
                                                                my ($dnat_address, $dnat_mask) = split("/", $destination);
                                                                @destination_options = ("-d", $dnat_address);
 
                                                                my ($dnat_address, $dnat_mask) = split("/", $destination);
                                                                @destination_options = ("-d", $dnat_address);