Skip to content

Commit 74fc831

Browse files
net/upnp: complete service improvements
1 parent 420efa0 commit 74fc831

File tree

6 files changed

+30
-12
lines changed

6 files changed

+30
-12
lines changed

net/upnp/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PLUGIN_NAME= upnp
2-
PLUGIN_VERSION= 1.8
2+
PLUGIN_VERSION= 1.9
33
PLUGIN_DEPENDS= miniupnpd
44
PLUGIN_COMMENT= UPnP IGD & PCP/NAT-PMP Service
55
PLUGIN_MAINTAINER= [email protected]

net/upnp/pkg-descr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ WWW: https://miniupnp.tuxfamily.org/
77
Plugin Changelog
88
================
99

10+
1.9
11+
12+
...
13+
14+
1.8
15+
16+
...
17+
1018
1.7
1119

1220
* Add option to allow arbitrary number of UPnP/NAT-PMP rules (contributed by Kreeblah)

net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ function miniupnpd_configure_do($verbose = false)
217217

218218
/* enable system uptime instead of miniupnpd uptime */
219219
if (!empty($upnp_config['sysuptime'])) {
220-
$config_text .= "system_uptime=yes\n";
220+
/* Disable to workaround daemon bug with PCP/NAT-PMP epoch on BSD */
221+
// $config_text .= "system_uptime=yes\n";
221222
}
222223

223224
/* set webgui url */
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
###################################################################
2+
# Local syslog-ng configuration filter definition [miniupnpd].
3+
###################################################################
4+
filter f_local_miniupnpd {
5+
program("miniupnpd");
6+
};

net/upnp/src/www/services_upnp.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,16 +233,16 @@ function miniupnpd_validate_port($port)
233233
</thead>
234234
<tbody>
235235
<tr>
236-
<td><a id="help_for_enable" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Enable");?></td>
236+
<td><a id="help_for_enable" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Enable service");?></td>
237237
<td>
238238
<input name="enable" type="checkbox" value="yes" <?=!empty($pconfig['enable']) ? "checked=\"checked\"" : ""; ?> />
239239
<div class="hidden" data-for="help_for_enable">
240-
<?=gettext("Start the autonomous port mapping service.");?>
240+
<?=gettext("Enable the autonomous port mapping service.");?>
241241
</div>
242242
</td>
243243
</tr>
244244
<tr>
245-
<td><a id="help_for_enable_upnp" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Allow UPnP IGD Port Mapping");?></td>
245+
<td><a id="help_for_enable_upnp" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Enable UPnP IGD protocol");?></td>
246246
<td>
247247
<input name="enable_upnp" type="checkbox" value="yes" <?=!empty($pconfig['enable_upnp']) ? "checked=\"checked\"" : ""; ?> />
248248
<div class="hidden" data-for="help_for_enable_upnp">
@@ -251,7 +251,7 @@ function miniupnpd_validate_port($port)
251251
</td>
252252
</tr>
253253
<tr>
254-
<td><a id="help_for_enable_natpmp" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Allow PCP/NAT-PMP Port Mapping");?></td>
254+
<td><a id="help_for_enable_natpmp" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Enable PCP/NAT-PMP protocols");?></td>
255255
<td>
256256
<input name="enable_natpmp" type="checkbox" value="yes" <?=!empty($pconfig['enable_natpmp']) ? "checked=\"checked\"" : ""; ?> />
257257
<div class="hidden" data-for="help_for_enable_natpmp">
@@ -393,12 +393,15 @@ function miniupnpd_validate_port($port)
393393
</thead>
394394
<tbody>
395395
<tr>
396-
<td><i class="fa fa-info-circle text-muted"></i> <?= gettext('UPnP IGD compatibility mode') ?></td>
396+
<td><a id="help_for_upnp_igd_compat" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?= gettext('UPnP IGD compatibility') ?></td>
397397
<td>
398398
<select name="upnp_igd_compat">
399399
<option value="igdv1" <?= ($pconfig['upnp_igd_compat'] ?? '') == 'igdv1' ? 'selected="selected"' : '' ?> ><?= gettext('IGDv1 (IPv4 only)') ?></option>
400400
<option value="igdv2" <?= ($pconfig['upnp_igd_compat'] ?? '') == 'igdv2' ? 'selected="selected"' : '' ?> ><?= gettext('IGDv2 (with workarounds)') ?></option>
401401
</select>
402+
<div class="hidden" data-for="help_for_upnp_igd_compat">
403+
<?=sprintf(gettext('Set compatibility mode (act as device) to workaround IGDv2-incompatible clients; %s are known to only work with %s.'), 'Sony PS, Activision CoD…', 'IGDv1');?>
404+
</div>
402405
</td>
403406
</tr>
404407
<tr>
@@ -436,7 +439,7 @@ function miniupnpd_validate_port($port)
436439
<table class="table table-striped opnsense_standard_table_form">
437440
<thead>
438441
<tr>
439-
<th colspan="2"><?=gettext("Custom Access Control List");?></th>
442+
<th colspan="2"><?=gettext("Access Control List");?></th>
440443
</tr>
441444
</thead>
442445
<tbody>

net/upnp/src/www/status_upnp.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@
7171
<th><?=gettext("Port")?></th>
7272
<th><?=gettext("External port")?></th>
7373
<th><?=gettext("Protocol")?></th>
74-
<th><?=gettext("Source IP")?></th>
75-
<th><?=gettext("Source port")?></th>
74+
<th><?=gettext("Remote IP")?></th>
75+
<th><?=gettext("Remote port")?></th>
7676
<th><?=gettext("Added via / description")?></th>
7777
</tr>
7878
</thead>
@@ -83,8 +83,8 @@
8383
!preg_match('/on (?P<iface>.+) inet6 proto (?P<proto>.+) from (?P<srcaddr>[^ ]+) (port = (?P<srcport>.+) )?to (?P<intaddr>.+) port = (?P<intport>\d+) (flags [^ ]+ )?keep state (label "(?P<descr>.+)" )?rtable [0-9]/', $rdr_entry, $matches)) {
8484
continue;
8585
}
86-
if (preg_match('/PCP ([A-Z]+) ([0-9a-f]{24})$/', $matches['descr'], $descrmatch) === 1) {
87-
$descr = "PCP ({$descrmatch[1]} nonce {$descrmatch[2]})";
86+
if (preg_match('/PCP [A-Z]+ ([0-9a-f]{24})$/', $matches['descr'], $descrmatch) === 1) {
87+
$descr = "PCP (nonce {$descrmatch[1]})";
8888
} elseif (preg_match('/^NAT-PMP \d+ \w+$/', $matches['descr'], $descrmatch) === 1) {
8989
$descr = 'NAT-PMP';
9090
} elseif (preg_match('/^pinhole-(\d+).*IGD2 pinhole$/', $matches['descr'], $descrmatch) === 1) {

0 commit comments

Comments
 (0)