mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
net-mgmt/snmp: "fix" the broken listening logic
PR: https://forum.opnsense.org/index.php?topic=8624.0
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
PLUGIN_NAME= snmp
|
||||
PLUGIN_VERSION= 1.2
|
||||
PLUGIN_VERSION= 1.3
|
||||
PLUGIN_DEPENDS= bsnmp-regex bsnmp-ucd
|
||||
PLUGIN_COMMENT= SNMP Server via bsnmpd
|
||||
PLUGIN_MAINTAINER= franco@opnsense.org
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (C) 2014-2017 Franco Fichtner <franco@opnsense.org>
|
||||
* Copyright (C) 2014-2018 Franco Fichtner <franco@opnsense.org>
|
||||
* Copyright (C) 2010 Ermal Luçi
|
||||
* Copyright (C) 2005-2006 Colin Smith <ethethlay@gmail.com>
|
||||
* Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>
|
||||
@@ -126,13 +126,16 @@ begemotSnmpdCommunityDisable = 1
|
||||
|
||||
EOD;
|
||||
|
||||
$bind_to_ip = "0.0.0.0";
|
||||
if (isset($config['snmpd']['bindip'])) {
|
||||
$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 = find_interface_ip($if);
|
||||
$bind_to_ip_maybe = find_interface_ip($if);
|
||||
if (is_ipaddr($bind_to_ip_maybe)) {
|
||||
$bind_to_ip = $bind_to_ip_maybe;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user