diff options
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/filter.inc | 2 | ||||
-rw-r--r-- | etc/inc/interfaces.inc | 40 |
2 files changed, 23 insertions, 19 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 0b67a78..f7d10ae 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -945,7 +945,7 @@ function filter_nat_rules_generate() if ($numberofnathosts > 0): foreach ($FilterIflist as $if => $ifcfg) { update_filter_reload_status("Creating outbound rules {$if} - ({$ifcfg['descr']})"); - if (interface_has_gateway($if) or $config['interfaces'][$if]['serialport']) { + if (interface_has_gateway($if)) { $target = $ifcfg['ip']; /* do not nat tftp proxy */ $natrules .= "no nat on \${$ifcfg['descr']} to port tftp\n"; diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 4a38327..26687e8 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -2572,28 +2572,32 @@ function get_interface_subnet($interface = "wan") /* return outside interfaces with a gateway */ function get_interfaces_with_gateway() { - global $config; + global $config; $ints = array(); /* loop interfaces, check config for outbound */ - foreach ($config['interfaces'] as $ifdescr => $ifname) { - switch ($ifname['ipaddr']) { - case "dhcp": - case "carpdev-dhcp": - case "pppoe": - case "pptp": - $ints[] = $ifdescr; - break; - default: - if ($ifname['pointtopoint']) - $ints[] = $ifdescr; - else if (!empty($ifname['gateway'])) - $ints[] = $ifdescr; - break; - } - } - return $ints; + foreach($config['interfaces'] as $ifdescr => $ifname) { + if($ifname['serialport']) { + $ints[] = $ifdescr; + continue; + } + switch ($ifname['ipaddr']) { + case "dhcp": + case "carpdev-dhcp": + case "pppoe": + case "pptp": + $ints[] = $ifdescr; + break; + default: + if ($ifname['pointtopoint']) + $ints[] = $ifdescr; + else if (!empty($ifname['gateway'])) + $ints[] = $ifdescr; + break; + } + } + return $ints; } /* return true if interface has a gateway */ |