diff options
author | jim-p <jimp@pfsense.org> | 2010-07-14 11:41:00 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2010-07-14 11:41:00 -0400 |
commit | 93b2c459855b82920decea1a2db080b0ae09b267 (patch) | |
tree | c3c6df76196e4c64949142e9671a6b4350309446 /usr/local/pkg/miniupnpd.inc | |
parent | f3e0a111e9af72c16b6391035b716bb067d418ed (diff) | |
download | pfsense-93b2c459855b82920decea1a2db080b0ae09b267.zip pfsense-93b2c459855b82920decea1a2db080b0ae09b267.tar.gz |
Add NAT-PMP support to UPnP. Fixes #262. Thanks to Salvatore LaMendola for the patch.
Diffstat (limited to 'usr/local/pkg/miniupnpd.inc')
-rw-r--r-- | usr/local/pkg/miniupnpd.inc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/usr/local/pkg/miniupnpd.inc b/usr/local/pkg/miniupnpd.inc index 8d45bad..2da8c93 100644 --- a/usr/local/pkg/miniupnpd.inc +++ b/usr/local/pkg/miniupnpd.inc @@ -85,6 +85,8 @@ } function validate_form_miniupnpd($post, $input_errors) { + if($post['enable'] && (!$post['enable_upnp'] && !$post['enable_natpmp'])) + $input_errors[] = 'At least one of \'UPnP\' or \'NAT-PMP\' must be allowed'; if($post['iface_array']) foreach($post['iface_array'] as $iface) if($iface == 'wan') @@ -223,6 +225,10 @@ if($upnp_config['upnpqueue']) $config_text .= "queue={$upnp_config['upnpqueue']}\n"; + /* Allow UPnP or NAT-PMP as requested */ + $config_text .= "enable_upnp=" . ( $upnp_config['enable_upnp'] ? "yes\n" : "no\n" ); + $config_text .= "enable_natpmp=" . ( $upnp_config['enable_natpmp'] ? "yes\n" : "no\n" ); + /* write out the configuration */ upnp_write_config($config_file, $config_text); |