Commit 19417130 authored by Micha Mueller's avatar Micha Mueller
Browse files

Fix compiler warning in SNMP plugin

parent 15edf163
......@@ -152,7 +152,6 @@ void SNMPConnection::close() {
}
int64_t SNMPConnection::get(const oid* const OID, size_t OIDLen) {
struct snmp_session* ss;
struct snmp_pdu *pdu, *response;
struct variable_list *vp;
int status;
......@@ -182,7 +181,7 @@ int64_t SNMPConnection::get(const oid* const OID, size_t OIDLen) {
char buf[1024];
while (vp) {
snprint_variable(buf, sizeof(buf), vp->name, vp->name_length, vp);
LOG(warning) << ss->peername << ": " << buf;
LOG(warning) << (&_snmpSession)->peername << ": " << buf;
vp = vp->next_variable;
}
}
......@@ -192,7 +191,7 @@ int64_t SNMPConnection::get(const oid* const OID, size_t OIDLen) {
LOG(error) << "Error in packet: " << snmp_errstring(response->errstat);
} else {
char* err;
snmp_error(ss, NULL, NULL, &err);
snmp_error(&_snmpSession, NULL, NULL, &err);
LOG(error) << "SNMP-get: " << err;
free(err);
}
......
......@@ -24,8 +24,8 @@ public:
SNMPSensorBase(const SNMPSensorBase& other) :
SensorBase(other),
_oidSuffix(other._oidSuffix),
_oidLen(other._oidLen) {
_oidLen(other._oidLen),
_oidSuffix(other._oidSuffix) {
memset(_oid, 0x0, sizeof(oid) * MAX_OID_LEN);
memcpy(_oid, other._oid, other._oidLen);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment