Skip to content

Commit 773eafe

Browse files
committed
fix GET-NEXT in PTLib-SNMP (for snmpwalk)
1 parent 6567749 commit 773eafe

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

changes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Changes from 5.3 to 5.4
22
=======================
3+
- BUGFIX(snmp.cxx) fix GET-NEXT in PTLib-SNMP (for snmpwalk)
34
- new module: MQTTAcct - send accounting to MQTT server
45
- BUGFIX(RasSrv.*) fix sending alternate gatekeeper list to endpoints with assigned gatekeeper
56
- BUGFIX(GkClient.cxx) improve DRQ from client gatekeeper

snmp.cxx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,9 +491,11 @@ PBoolean PTLibSNMPAgent::OnGetRequest(PINDEX reqID, PSNMP::BindingList & vars, P
491491

492492
PBoolean PTLibSNMPAgent::OnGetNextRequest(PINDEX reqID, PSNMP::BindingList & vars, PSNMP::ErrorType & errCode)
493493
{
494-
const PString & oid = vars.front().first;
494+
PString oid = vars.front().first;
495+
if (oid.Right(2) == ".0")
496+
oid = oid.Left(oid.GetLength() - 2);
495497
list<PString>::const_iterator it = m_nextList.begin();
496-
while(it != m_nextList.end() && (OIDCmp(*it, oid) == -1)) {
498+
while(it != m_nextList.end() && (OIDCmp(*it, oid) <= 0)) {
497499
++it;
498500
}
499501
if (it != m_nextList.end() /* TODO: && is in same space? */) {

0 commit comments

Comments
 (0)