net/upnp: add default lifetimes

PR: https://forum.opnsense.org/index.php?topic=4766.0

(cherry picked from commit 5d5804bae4)
(cherry picked from commit d0b88f1f5e)
(cherry picked from commit 601286cb8a)
This commit is contained in:
Franco Fichtner 2017-03-11 15:53:04 +01:00
parent 6b12f5d776
commit 071ba27f3c
2 changed files with 6 additions and 1 deletions

View file

@ -1,5 +1,5 @@
PLUGIN_NAME= upnp
PLUGIN_VERSION= 1.1
PLUGIN_VERSION= 1.2
PLUGIN_DEPENDS= miniupnpd
PLUGIN_COMMENT= Universal Plug and Play Service
PLUGIN_MAINTAINER= franco@opnsense.org

View file

@ -211,6 +211,11 @@ function miniupnpd_configure_do($verbose = false)
$config_text .= "enable_upnp=" . ( $upnp_config['enable_upnp'] ? "yes\n" : "no\n" );
$config_text .= "enable_natpmp=" . ( $upnp_config['enable_natpmp'] ? "yes\n" : "no\n" );
/* configure lifetimes to force periodic expire */
$config_text .= "clean_ruleset_interval=600\n";
$config_text .= "min_lifetime=120\n";
$config_text .= "max_lifetime=86400\n";
/* write out the configuration */
file_put_contents('/var/etc/miniupnpd.conf', $config_text);