net/snmp: kill get_possible_listen_ips() use

This commit is contained in:
Franco Fichtner
2018-09-16 15:30:25 +02:00
parent 3fc2e88312
commit 98966ab3ff
3 changed files with 8 additions and 15 deletions
+1
View File
@@ -1,5 +1,6 @@
PLUGIN_NAME= snmp
PLUGIN_VERSION= 1.3
PLUGIN_REVISION= 1
PLUGIN_DEPENDS= bsnmp-regex bsnmp-ucd
PLUGIN_COMMENT= End of life, superseded by Net-SNMP plugin
PLUGIN_MAINTAINER= franco@opnsense.org
@@ -128,14 +128,9 @@ EOD;
$bind_to_ip = '0.0.0.0';
if (!empty($config['snmpd']['bindip'])) {
if (is_ipaddr($config['snmpd']['bindip'])) {
$bind_to_ip = $config['snmpd']['bindip'];
} else {
$if = get_real_interface($config['snmpd']['bindip']);
$bind_to_ip_maybe = find_interface_ip($if);
if (is_ipaddr($bind_to_ip_maybe)) {
$bind_to_ip = $bind_to_ip_maybe;
}
$bind_to_ip_maybe = find_interface_ip(get_real_interface($config['snmpd']['bindip']));
if (is_ipaddr($bind_to_ip_maybe)) {
$bind_to_ip = $bind_to_ip_maybe;
}
}
+4 -7
View File
@@ -327,14 +327,11 @@ include("head.inc");
<td>
<select name="bindip" class="selectpicker">
<option value=""><?= gettext('All') ?></option>
<?php
foreach (get_possible_listen_ips() as $lip):?>
<option value="<?=$lip['value'];?>" <?=$lip['value'] == $pconfig['bindip'] ? "selected=\"selected\"" : "";?>>
<?=htmlspecialchars($lip['name']);?>
<?php foreach (get_configured_interface_with_descr() as $ifname => $ifdescr): ?>
<option value="<?= html_safe($ifname) ?>" <?= $ifname == $pconfig['bindip'] ? 'selected="selected"' : '' ?>>
<?= htmlspecialchars($ifdescr) ?>
</option>
<?php
endforeach; ?>
<?php endforeach ?>
</select>
</td>
</tr>