Skip to content

Commit

Permalink
net-mgmt/snmp: "fix" the broken listening logic
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed May 14, 2018
1 parent 2aecb80 commit 8f7e89f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion net-mgmt/snmp/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
11 changes: 7 additions & 4 deletions net-mgmt/snmp/src/etc/inc/plugins.inc.d/bsnmpd.inc
Original file line number Diff line number Diff line change
@@ -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>
Expand Down Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit 8f7e89f

Please sign in to comment.