summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2008-07-14 05:11:02 +0000
committerScott Ullrich <sullrich@pfsense.org>2008-07-14 05:11:02 +0000
commit9803ecec5c631ea56ed28a6001c2cf316619fe06 (patch)
tree050efbff0fdb18aa585d31ff29a02566b07dc123
parent3acf72fae92831ad4d3e5699ae9ac4d2388ec252 (diff)
downloadpfsense-9803ecec5c631ea56ed28a6001c2cf316619fe06.zip
pfsense-9803ecec5c631ea56ed28a6001c2cf316619fe06.tar.gz
* Start inetd regardless if nat entries exist due to tftp proxy needing it.
-rw-r--r--etc/inc/filter.inc31
1 files changed, 16 insertions, 15 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 09c7291..50fa982 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -1088,13 +1088,14 @@ function filter_nat_rules_generate() {
mwexec("rm /var/etc/inetd.conf");
touch("/var/etc/inetd.conf");
- if (isset($config['nat']['rule'])) {
- $natrules .= "# NAT Inbound Redirects\n";
+ // Open inetd.conf write handle
+ $inetd_fd = fopen("/var/etc/inetd.conf","w");
- $inetd_fd = fopen("/var/etc/inetd.conf","w");
+ /* add tftp protocol helper */
+ fwrite($inetd_fd, "tftp\tdgram\tudp\twait\t\troot\t/usr/local/sbin/tftp-proxy -v\n");
- /* add tftp protocol helper */
- fwrite($inetd_fd, "tftp\tdgram\tudp\twait\t\troot\t/usr/local/sbin/tftp-proxy -v\n");
+ if (isset($config['nat']['rule'])) {
+ $natrules .= "# NAT Inbound Redirects\n";
if(!isset($config['system']['disablenatreflection'])) {
/* start redirects on port 19000 of localhost */
@@ -1399,18 +1400,18 @@ function filter_nat_rules_generate() {
$natrules .= "\n";
}
-
- if(!isset($config['system']['disablenatreflection'])) {
- fclose($inetd_fd);
- $helpers = trim(exec("/bin/ps ax | /usr/bin/grep inetd | /usr/bin/grep -v grep | /usr/bin/grep 127"));
- if(!$helpers)
- mwexec("/usr/sbin/inetd -wW -R 0 -a 127.0.0.1 /var/etc/inetd.conf");
- else
- mwexec("/usr/bin/killall -HUP inetd");
-
- }
+
}
+ fclose($inetd_fd); // Close file handle
+
+ // Check if inetd is running, if not start it. If so, restart it gracefully.
+ $helpers = trim(exec("/bin/ps ax | /usr/bin/grep inetd | /usr/bin/grep -v grep | /usr/bin/grep 127"));
+ if(!$helpers)
+ mwexec("/usr/sbin/inetd -wW -R 0 -a 127.0.0.1 /var/etc/inetd.conf");
+ else
+ mwexec("/usr/bin/killall -HUP inetd");
+
if ($pptpdcfg['mode'] && $pptpdcfg['mode'] != "off") {
if ($pptpdcfg['mode'] == "server")
OpenPOWER on IntegriCloud