From ce1b522bfa9f980e9067d7954f6602c2b9da5fc0 Mon Sep 17 00:00:00 2001 From: ilyam8 Date: Sun, 11 Oct 2026 19:24:01 +0300 Subject: [PATCH 1/3] test: pin a request sent back unchanged as its own answer The fake agent can reflect a request. A reflected request carries the client's own msgID, request ID and, when authenticated, its own digest and ciphertext, and the client returns it as a successful reply: a Get at noAuthNoPriv and authNoPriv, a Set at authNoPriv and authPriv, and an SNMPv2c Get. --- engine_requests_test.go | 4 ++ engine_v3_agent_test.go | 9 ++- engine_v3_test.go | 20 +++++++ testdata/engine/requests.golden | 14 +++++ testdata/engine/v3.golden | 97 +++++++++++++++++++++++++++++++++ 5 files changed, 143 insertions(+), 1 deletion(-) diff --git a/engine_requests_test.go b/engine_requests_test.go index c8dbba4..bc93c47 100644 --- a/engine_requests_test.go +++ b/engine_requests_test.go @@ -311,6 +311,10 @@ func engineScenarios() map[string]engineScenario { agent: answerWith(func(p *SnmpPacket) { p.PDUType = GetRequest }, sysDescr), knownBug: "the reply's PDU type is not checked", }, + "answer/reflected-request": { + agent: func(_ int, req []byte) []agentReply { return []agentReply{{data: bytes.Clone(req)}} }, + knownBug: "the reply's PDU type is not checked: the client takes its own request, sent back unchanged, as the answer", + }, "answer/report": { agent: answerWith(func(p *SnmpPacket) { p.PDUType = Report }, sysDescr), knownBug: "the reply's PDU type is not checked", diff --git a/engine_v3_agent_test.go b/engine_v3_agent_test.go index bdb7c72..38d5d13 100644 --- a/engine_v3_agent_test.go +++ b/engine_v3_agent_test.go @@ -75,7 +75,10 @@ type agentAnswer struct { raw func(*v3Message) // edits the encoded answer, after edit encode func(v3Message) []byte // encodes the answer after raw, instead of v3Message.bytes drop bool // no answer - why string + // reflect sends the request back unchanged instead of an answer, as a + // loop or an on-path sender does. + reflect bool + why string } const ( @@ -178,6 +181,10 @@ func (a *fakeV3Agent) handle(n int, data []byte) []agentReply { a.tr.addf("agent: drops #%d (%s)", n, ans.why) return nil } + if ans.reflect { + a.tr.addf("agent: reflects #%d unchanged (%s)", n, ans.why) + return []agentReply{{data: bytes.Clone(data)}} + } out := a.answer(req, ans) a.tr.addf("agent: answers #%d with %s at %s (%s)", n, describeAnswerPDU(out), describeFlags(out.MsgFlags), ans.why) diff --git a/engine_v3_test.go b/engine_v3_test.go index 833881d..6a166b3 100644 --- a/engine_v3_test.go +++ b/engine_v3_test.go @@ -997,6 +997,26 @@ func v3Scenarios() map[string]v3Scenario { "answer/other-version/noauth": { user: "codec-noauth", script: onRequest(2, agentAnswer{why: "SNMPv2c GetResponse", edit: asV2c}), }, + // A request sent back unchanged carries the client's own msgID, + // request ID and, when authenticated, its own digest and ciphertext. + "answer/reflected-request/noauth": { + user: "codec-noauth", script: onRequest(2, agentAnswer{reflect: true, why: "the request sent back"}), + knownBug: "the reply's PDU type is not checked: the client takes its own request, sent back unchanged, as the answer", + }, + "answer/reflected-request/md5": { + user: "codec-md5", script: onRequest(2, agentAnswer{reflect: true, why: "the request sent back"}), + knownBug: "the reply's PDU type is not checked: the client takes its own request, sent back unchanged, as the answer", + }, + "answer/reflected-request/md5-set": { + user: "codec-md5", script: onRequest(2, agentAnswer{reflect: true, why: "the request sent back"}), + run: func(x *GoSNMP, _ *fakeV3Agent) (*SnmpPacket, error) { return setEngineOID(x) }, + knownBug: "the reply's PDU type is not checked: the client takes its own request, sent back unchanged, as the answer", + }, + "answer/reflected-request/sha-aes-set": { + user: "codec-sha-aes", script: onRequest(2, agentAnswer{reflect: true, why: "the request sent back"}), + run: func(x *GoSNMP, _ *fakeV3Agent) (*SnmpPacket, error) { return setEngineOID(x) }, + knownBug: "the reply's PDU type is not checked: the client takes its own request, sent back unchanged, as the answer", + }, // An SNMPv2c message whose body reads as a scoped PDU, with the // request's request ID, does not answer an SNMPv3 request. "answer/other-version/noauth-scoped-body": { diff --git a/testdata/engine/requests.golden b/testdata/engine/requests.golden index 0351c61..8bc6441 100644 --- a/testdata/engine/requests.golden +++ b/testdata/engine/requests.golden @@ -456,6 +456,20 @@ 3s result: packet nil, error "request timeout (after 2 retries)" *errors.errorString 3s client after: retries=2 next request id=1004 +== requests/answer/reflected-request +0s client: 2c timeout=1s retries=2 exponential=false +0s deadline +1s +0s hook PreSend +0s write #1: 2c "public" GetRequest id=1001 [.1.3.6.1.2.1.1.1.0] +0s agent answers #1 after 0s +0s hook OnSent +0s read from 127.0.0.2:161: 2c "public" GetRequest id=1001 [.1.3.6.1.2.1.1.1.0] +0s hook OnRecv +0s hook OnFinish +0s result: packet 2c "public" GetRequest id=1001 [.1.3.6.1.2.1.1.1.0], no error +0s client after: retries=2 next request id=1002 +0s known bug: the reply's PDU type is not checked: the client takes its own request, sent back unchanged, as the answer + == requests/answer/report 0s client: 2c timeout=1s retries=2 exponential=false 0s deadline +1s diff --git a/testdata/engine/v3.golden b/testdata/engine/v3.golden index dfcdee7..fe530e1 100644 --- a/testdata/engine/v3.golden +++ b/testdata/engine/v3.golden @@ -759,6 +759,103 @@ 0s result: packet 3 msgID=2003 authPriv GetResponse id=1003 context="\x80\x00\x1f\x88\x04codec-agent"/"" usm="codec-sha-aes"/"\x80\x00\x1f\x88\x04codec-agent"/7/1000 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"], no error 0s client after: engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 keys=current context engine="\x80\x00\x1f\x88\x04codec-agent" +== v3/answer/reflected-request/md5 +0s client: user="codec-md5" authNoPriv+reportable timeout=1s retries=2 +0s deadline +1s +0s hook PreSend +0s write #1: 3 msgID=2001 noAuthNoPriv+reportable user="" engine="" boots=0 time=0 context=""/"" GetRequest id=1001 [] +0s agent: answers #1 with Report id=1001 msgID=2001 [.1.3.6.1.6.3.15.1.1.4.0=Counter32:1] at noAuthNoPriv (unknown engine ID) +0s agent answers #1 after 0s +0s hook OnSent +0s read from 127.0.0.2:161: 3 msgID=2001 noAuthNoPriv user="" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 context="\x80\x00\x1f\x88\x04codec-agent"/"" Report id=1001 [.1.3.6.1.6.3.15.1.1.4.0=Counter32:1] +0s hook OnRecv +0s hook OnFinish +0s deadline +1s +0s hook PreSend +0s write #2: 3 msgID=2002 authNoPriv+reportable user="codec-md5" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 context="\x80\x00\x1f\x88\x04codec-agent"/"" GetRequest id=1002 [.1.3.6.1.2.1.1.1.0] +0s agent: reflects #2 unchanged (the request sent back) +0s agent answers #2 after 0s +0s hook OnSent +0s read from 127.0.0.2:161: 3 msgID=2002 authNoPriv+reportable user="codec-md5" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 context="\x80\x00\x1f\x88\x04codec-agent"/"" GetRequest id=1002 [.1.3.6.1.2.1.1.1.0] +0s hook OnRecv +0s hook OnFinish +0s result: packet 3 msgID=2002 authNoPriv+reportable GetRequest id=1002 context="\x80\x00\x1f\x88\x04codec-agent"/"" usm="codec-md5"/"\x80\x00\x1f\x88\x04codec-agent"/7/1000 [.1.3.6.1.2.1.1.1.0], no error +0s client after: engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 keys=current context engine="\x80\x00\x1f\x88\x04codec-agent" +0s known bug: the reply's PDU type is not checked: the client takes its own request, sent back unchanged, as the answer + +== v3/answer/reflected-request/md5-set +0s client: user="codec-md5" authNoPriv+reportable timeout=1s retries=2 +0s deadline +1s +0s hook PreSend +0s write #1: 3 msgID=2001 noAuthNoPriv+reportable user="" engine="" boots=0 time=0 context=""/"" GetRequest id=1001 [] +0s agent: answers #1 with Report id=1001 msgID=2001 [.1.3.6.1.6.3.15.1.1.4.0=Counter32:1] at noAuthNoPriv (unknown engine ID) +0s agent answers #1 after 0s +0s hook OnSent +0s read from 127.0.0.2:161: 3 msgID=2001 noAuthNoPriv user="" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 context="\x80\x00\x1f\x88\x04codec-agent"/"" Report id=1001 [.1.3.6.1.6.3.15.1.1.4.0=Counter32:1] +0s hook OnRecv +0s hook OnFinish +0s deadline +1s +0s hook PreSend +0s write #2: 3 msgID=2002 authNoPriv+reportable user="codec-md5" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 context="\x80\x00\x1f\x88\x04codec-agent"/"" SetRequest id=1002 [.1.3.6.1.2.1.1.1.0=OctetString:"codec"] +0s agent: reflects #2 unchanged (the request sent back) +0s agent answers #2 after 0s +0s hook OnSent +0s read from 127.0.0.2:161: 3 msgID=2002 authNoPriv+reportable user="codec-md5" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 context="\x80\x00\x1f\x88\x04codec-agent"/"" SetRequest id=1002 [.1.3.6.1.2.1.1.1.0=OctetString:"codec"] +0s hook OnRecv +0s hook OnFinish +0s result: packet 3 msgID=2002 authNoPriv+reportable SetRequest id=1002 context="\x80\x00\x1f\x88\x04codec-agent"/"" usm="codec-md5"/"\x80\x00\x1f\x88\x04codec-agent"/7/1000 [.1.3.6.1.2.1.1.1.0=OctetString:"codec"], no error +0s client after: engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 keys=current context engine="\x80\x00\x1f\x88\x04codec-agent" +0s known bug: the reply's PDU type is not checked: the client takes its own request, sent back unchanged, as the answer + +== v3/answer/reflected-request/noauth +0s client: user="codec-noauth" noAuthNoPriv+reportable timeout=1s retries=2 +0s deadline +1s +0s hook PreSend +0s write #1: 3 msgID=2001 noAuthNoPriv+reportable user="" engine="" boots=0 time=0 context=""/"" GetRequest id=1001 [] +0s agent: answers #1 with Report id=1001 msgID=2001 [.1.3.6.1.6.3.15.1.1.4.0=Counter32:1] at noAuthNoPriv (unknown engine ID) +0s agent answers #1 after 0s +0s hook OnSent +0s read from 127.0.0.2:161: 3 msgID=2001 noAuthNoPriv user="" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 context="\x80\x00\x1f\x88\x04codec-agent"/"" Report id=1001 [.1.3.6.1.6.3.15.1.1.4.0=Counter32:1] +0s hook OnRecv +0s hook OnFinish +0s deadline +1s +0s hook PreSend +0s write #2: 3 msgID=2002 noAuthNoPriv+reportable user="codec-noauth" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 context="\x80\x00\x1f\x88\x04codec-agent"/"" GetRequest id=1002 [.1.3.6.1.2.1.1.1.0] +0s agent: reflects #2 unchanged (the request sent back) +0s agent answers #2 after 0s +0s hook OnSent +0s read from 127.0.0.2:161: 3 msgID=2002 noAuthNoPriv+reportable user="codec-noauth" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 context="\x80\x00\x1f\x88\x04codec-agent"/"" GetRequest id=1002 [.1.3.6.1.2.1.1.1.0] +0s hook OnRecv +0s hook OnFinish +0s result: packet 3 msgID=2002 noAuthNoPriv+reportable GetRequest id=1002 context="\x80\x00\x1f\x88\x04codec-agent"/"" usm="codec-noauth"/"\x80\x00\x1f\x88\x04codec-agent"/7/1000 [.1.3.6.1.2.1.1.1.0], no error +0s client after: engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 keys=none context engine="\x80\x00\x1f\x88\x04codec-agent" +0s known bug: the reply's PDU type is not checked: the client takes its own request, sent back unchanged, as the answer + +== v3/answer/reflected-request/sha-aes-set +0s client: user="codec-sha-aes" authPriv+reportable timeout=1s retries=2 +0s deadline +1s +0s hook PreSend +0s write #1: 3 msgID=2001 noAuthNoPriv+reportable user="" engine="" boots=0 time=0 context=""/"" GetRequest id=1001 [] +0s agent: answers #1 with Report id=1001 msgID=2001 [.1.3.6.1.6.3.15.1.1.4.0=Counter32:1] at noAuthNoPriv (unknown engine ID) +0s agent answers #1 after 0s +0s hook OnSent +0s read from 127.0.0.2:161: 3 msgID=2001 noAuthNoPriv user="" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 context="\x80\x00\x1f\x88\x04codec-agent"/"" Report id=1001 [.1.3.6.1.6.3.15.1.1.4.0=Counter32:1] +0s hook OnRecv +0s hook OnFinish +0s deadline +1s +0s hook PreSend +0s write #2: 3 msgID=2002 authPriv+reportable user="codec-sha-aes" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 salt=0000000000000102 encrypted +0s agent: #2 decrypts to context="\x80\x00\x1f\x88\x04codec-agent"/"" SetRequest id=1002 [.1.3.6.1.2.1.1.1.0=OctetString:"codec"] +0s agent: reflects #2 unchanged (the request sent back) +0s agent answers #2 after 0s +0s hook OnSent +0s read from 127.0.0.2:161: 3 msgID=2002 authPriv+reportable user="codec-sha-aes" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 salt=0000000000000102 encrypted +0s hook OnRecv +0s hook OnFinish +0s result: packet 3 msgID=2002 authPriv+reportable SetRequest id=1002 context="\x80\x00\x1f\x88\x04codec-agent"/"" usm="codec-sha-aes"/"\x80\x00\x1f\x88\x04codec-agent"/7/1000 [.1.3.6.1.2.1.1.1.0=OctetString:"codec"], no error +0s client after: engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 keys=current context engine="\x80\x00\x1f\x88\x04codec-agent" +0s known bug: the reply's PDU type is not checked: the client takes its own request, sent back unchanged, as the answer + == v3/answer/report-for-other-message 0s client: user="codec-noauth" noAuthNoPriv+reportable timeout=1s retries=2 0s deadline +1s From 7414f50c4a732893d5887df3c88af7cc18c8dc2c Mon Sep 17 00:00:00 2001 From: ilyam8 Date: Sun, 11 Oct 2026 19:24:55 +0300 Subject: [PATCH 2/3] fix: answer a request only with a Response or a Report answers never checked the reply's PDU type, so a request sent back unchanged, which carries the client's own msgID, request ID and digest, was returned as a successful reply at every security level, a Set included. A reply that is not a Report reportKindOf maps now answers only as a Response (GetResponse), as in net-snmp; other PDU types, and a Report with more than one varbind, are read past. --- engine.go | 25 +++++--- engine_requests_test.go | 10 +-- engine_v3_test.go | 12 ++-- testdata/engine/requests.golden | 104 +++++++++++++++++++++++++++----- testdata/engine/v3.golden | 103 +++++++++++++++++++++++-------- 5 files changed, 189 insertions(+), 65 deletions(-) diff --git a/engine.go b/engine.go index 6cbc521..073218f 100644 --- a/engine.go +++ b/engine.go @@ -400,30 +400,35 @@ func (e *exchange) unauthenticatedReport(resp []byte, cursor int, reply *SnmpPac // answers reports whether reply answers the request, and with which error. An // SNMPv3 request is answered only by an SNMPv3 reply with the msgID of its // current or an earlier attempt, and an SNMPv3 reply answers no other request -// (RFC 3412 section 7.2 step 10). A Report then answers with its kind's error, -// none for a resync Report; another reply with the request ID of the current -// or an earlier attempt. Known bugs: nothing else of the reply is compared -// with the request (its PDU type, the SNMPv1 and SNMPv2c versions, the +// (RFC 3412 section 7.2 step 10). A Report that reportKindOf maps then answers +// with its kind's error, none for a resync Report; any other reply only as a +// Response (GetResponse), with the request ID of the current or an earlier +// attempt: a request sent back unchanged carries the client's own IDs and +// digest, and other PDUs answer no request. Known bugs: nothing else of the +// reply is compared with the request (the SNMPv1 and SNMPv2c versions, the // security model, level and context of RFC 3412 section 7.2 step 12 b, nor, // for a request without authentication, the user and engine ID); an empty -// reply without an error status answers before its request ID is checked; -// request ID 0 answers any request. +// Response without an error status answers before its request ID is checked; +// a Response with request ID 0 answers any request. func (e *exchange) answers(reply *SnmpPacket, earlier []sentIDs) (bool, error) { if reply.Version == Version3 || e.packet.Version == Version3 { if reply.Version != e.packet.Version || !e.sentWithMsgID(reply.MsgID, earlier) { return false, nil } } - if reply.Error == NoError && len(reply.Variables) < 1 { - e.x.Logger.Print("Empty result: the reply answers the request") - return true, nil - } if kind, ok := reportKindOf(reply); ok { if kind.resync { return true, nil } return true, kind.err } + if reply.PDUType != GetResponse { + return false, nil + } + if reply.Error == NoError && len(reply.Variables) < 1 { + e.x.Logger.Print("Empty result: the reply answers the request") + return true, nil + } return e.sentWithRequestID(reply.RequestID, earlier) || reply.RequestID == 0, nil } diff --git a/engine_requests_test.go b/engine_requests_test.go index bc93c47..f0fee6b 100644 --- a/engine_requests_test.go +++ b/engine_requests_test.go @@ -298,7 +298,6 @@ func engineScenarios() map[string]engineScenario { } return []agentReply{{data: b}} }, - knownBug: "a reply with request ID 0 is accepted for any request, even a v1 Trap", }, "answer/empty": {agent: answerWith(nil)}, "answer/empty-wrong-id": { @@ -308,16 +307,13 @@ func engineScenarios() map[string]engineScenario { "answer/empty-with-error-status-wrong-id": {agent: answerWith(func(p *SnmpPacket) { p.RequestID += 100; p.Error = GenErr })}, "answer/error-status": {agent: answerWith(func(p *SnmpPacket) { p.Error, p.ErrorIndex = NoSuchName, 1 }, SnmpPDU{Name: engineOID, Type: Null})}, "answer/not-a-response": { - agent: answerWith(func(p *SnmpPacket) { p.PDUType = GetRequest }, sysDescr), - knownBug: "the reply's PDU type is not checked", + agent: answerWith(func(p *SnmpPacket) { p.PDUType = GetRequest }, sysDescr), }, "answer/reflected-request": { - agent: func(_ int, req []byte) []agentReply { return []agentReply{{data: bytes.Clone(req)}} }, - knownBug: "the reply's PDU type is not checked: the client takes its own request, sent back unchanged, as the answer", + agent: func(_ int, req []byte) []agentReply { return []agentReply{{data: bytes.Clone(req)}} }, }, "answer/report": { - agent: answerWith(func(p *SnmpPacket) { p.PDUType = Report }, sysDescr), - knownBug: "the reply's PDU type is not checked", + agent: answerWith(func(p *SnmpPacket) { p.PDUType = Report }, sysDescr), }, "answer/unknown-pdu-type": { agent: answerRaw(func(r []byte) []byte { diff --git a/engine_v3_test.go b/engine_v3_test.go index 6a166b3..bbfbc21 100644 --- a/engine_v3_test.go +++ b/engine_v3_test.go @@ -1001,21 +1001,17 @@ func v3Scenarios() map[string]v3Scenario { // request ID and, when authenticated, its own digest and ciphertext. "answer/reflected-request/noauth": { user: "codec-noauth", script: onRequest(2, agentAnswer{reflect: true, why: "the request sent back"}), - knownBug: "the reply's PDU type is not checked: the client takes its own request, sent back unchanged, as the answer", }, "answer/reflected-request/md5": { user: "codec-md5", script: onRequest(2, agentAnswer{reflect: true, why: "the request sent back"}), - knownBug: "the reply's PDU type is not checked: the client takes its own request, sent back unchanged, as the answer", }, "answer/reflected-request/md5-set": { user: "codec-md5", script: onRequest(2, agentAnswer{reflect: true, why: "the request sent back"}), - run: func(x *GoSNMP, _ *fakeV3Agent) (*SnmpPacket, error) { return setEngineOID(x) }, - knownBug: "the reply's PDU type is not checked: the client takes its own request, sent back unchanged, as the answer", + run: func(x *GoSNMP, _ *fakeV3Agent) (*SnmpPacket, error) { return setEngineOID(x) }, }, "answer/reflected-request/sha-aes-set": { user: "codec-sha-aes", script: onRequest(2, agentAnswer{reflect: true, why: "the request sent back"}), - run: func(x *GoSNMP, _ *fakeV3Agent) (*SnmpPacket, error) { return setEngineOID(x) }, - knownBug: "the reply's PDU type is not checked: the client takes its own request, sent back unchanged, as the answer", + run: func(x *GoSNMP, _ *fakeV3Agent) (*SnmpPacket, error) { return setEngineOID(x) }, }, // An SNMPv2c message whose body reads as a scoped PDU, with the // request's request ID, does not answer an SNMPv3 request. @@ -1053,19 +1049,19 @@ func v3Scenarios() map[string]v3Scenario { }), knownBug: "a reply with another security model is accepted, then returned together with the model mismatch error", }, + // A Report carries one varbind (RFC 3412 section 7.1 step 3 d): one with + // two is read past. "answer/report-two-varbinds": { user: "codec-noauth", script: onRequest(2, agentAnswer{ report: usmStatsNotInTimeWindows, why: "Report with two varbinds", edit: func(p *SnmpPacket) { p.Variables = append(p.Variables, sysDescr) }, }), - knownBug: "a Report with more than one varbind is returned as a successful reply", }, "answer/report-two-varbinds-error-oid": { user: "codec-noauth", script: onRequest(2, agentAnswer{ report: usmStatsUnknownUserNames, why: "Report with two varbinds", edit: func(p *SnmpPacket) { p.Variables = append(p.Variables, sysDescr) }, }), - knownBug: "a Report with more than one varbind is returned as a successful reply", }, // Reports after the engine is known: whether their engine diff --git a/testdata/engine/requests.golden b/testdata/engine/requests.golden index 8bc6441..dfddb93 100644 --- a/testdata/engine/requests.golden +++ b/testdata/engine/requests.golden @@ -267,10 +267,28 @@ 0s hook OnSent 0s read from 127.0.0.2:161: 2c "public" GetRequest id=1001 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"] 0s hook OnRecv -0s hook OnFinish -0s result: packet 2c "public" GetRequest id=1001 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"], no error -0s client after: retries=2 next request id=1002 -0s known bug: the reply's PDU type is not checked +1s read from 127.0.0.2:161: deadline +1s hook OnRetry +1s deadline +1s +1s hook PreSend +1s write #2: 2c "public" GetRequest id=1002 [.1.3.6.1.2.1.1.1.0] +1s agent answers #2 after 0s +1s hook OnSent +1s read from 127.0.0.2:161: 2c "public" GetRequest id=1002 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"] +1s hook OnRecv +2s read from 127.0.0.2:161: deadline +2s hook OnRetry +2s deadline +1s +2s hook PreSend +2s write #3: 2c "public" GetRequest id=1003 [.1.3.6.1.2.1.1.1.0] +2s agent answers #3 after 0s +2s hook OnSent +2s read from 127.0.0.2:161: 2c "public" GetRequest id=1003 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"] +2s hook OnRecv +3s read from 127.0.0.2:161: deadline +3s hook OnRetry +3s result: packet nil, error "request timeout (after 2 retries)" *errors.errorString +3s client after: retries=2 next request id=1004 == requests/answer/other-community 0s client: 2c timeout=1s retries=2 exponential=false @@ -465,10 +483,28 @@ 0s hook OnSent 0s read from 127.0.0.2:161: 2c "public" GetRequest id=1001 [.1.3.6.1.2.1.1.1.0] 0s hook OnRecv -0s hook OnFinish -0s result: packet 2c "public" GetRequest id=1001 [.1.3.6.1.2.1.1.1.0], no error -0s client after: retries=2 next request id=1002 -0s known bug: the reply's PDU type is not checked: the client takes its own request, sent back unchanged, as the answer +1s read from 127.0.0.2:161: deadline +1s hook OnRetry +1s deadline +1s +1s hook PreSend +1s write #2: 2c "public" GetRequest id=1002 [.1.3.6.1.2.1.1.1.0] +1s agent answers #2 after 0s +1s hook OnSent +1s read from 127.0.0.2:161: 2c "public" GetRequest id=1002 [.1.3.6.1.2.1.1.1.0] +1s hook OnRecv +2s read from 127.0.0.2:161: deadline +2s hook OnRetry +2s deadline +1s +2s hook PreSend +2s write #3: 2c "public" GetRequest id=1003 [.1.3.6.1.2.1.1.1.0] +2s agent answers #3 after 0s +2s hook OnSent +2s read from 127.0.0.2:161: 2c "public" GetRequest id=1003 [.1.3.6.1.2.1.1.1.0] +2s hook OnRecv +3s read from 127.0.0.2:161: deadline +3s hook OnRetry +3s result: packet nil, error "request timeout (after 2 retries)" *errors.errorString +3s client after: retries=2 next request id=1004 == requests/answer/report 0s client: 2c timeout=1s retries=2 exponential=false @@ -479,10 +515,28 @@ 0s hook OnSent 0s read from 127.0.0.2:161: 2c "public" Report id=1001 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"] 0s hook OnRecv -0s hook OnFinish -0s result: packet 2c "public" Report id=1001 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"], no error -0s client after: retries=2 next request id=1002 -0s known bug: the reply's PDU type is not checked +1s read from 127.0.0.2:161: deadline +1s hook OnRetry +1s deadline +1s +1s hook PreSend +1s write #2: 2c "public" GetRequest id=1002 [.1.3.6.1.2.1.1.1.0] +1s agent answers #2 after 0s +1s hook OnSent +1s read from 127.0.0.2:161: 2c "public" Report id=1002 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"] +1s hook OnRecv +2s read from 127.0.0.2:161: deadline +2s hook OnRetry +2s deadline +1s +2s hook PreSend +2s write #3: 2c "public" GetRequest id=1003 [.1.3.6.1.2.1.1.1.0] +2s agent answers #3 after 0s +2s hook OnSent +2s read from 127.0.0.2:161: 2c "public" Report id=1003 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"] +2s hook OnRecv +3s read from 127.0.0.2:161: deadline +3s hook OnRetry +3s result: packet nil, error "request timeout (after 2 retries)" *errors.errorString +3s client after: retries=2 next request id=1004 == requests/answer/second-attempt 0s client: 2c timeout=1s retries=2 exponential=false @@ -584,10 +638,28 @@ 0s hook OnSent 0s read from 127.0.0.2:161: 1 "public" Trap id=0 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"] 0s hook OnRecv -0s hook OnFinish -0s result: packet 1 "public" Trap id=0 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"], no error -0s client after: retries=2 next request id=1002 -0s known bug: a reply with request ID 0 is accepted for any request, even a v1 Trap +1s read from 127.0.0.2:161: deadline +1s hook OnRetry +1s deadline +1s +1s hook PreSend +1s write #2: 2c "public" GetRequest id=1002 [.1.3.6.1.2.1.1.1.0] +1s agent answers #2 after 0s +1s hook OnSent +1s read from 127.0.0.2:161: 1 "public" Trap id=0 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"] +1s hook OnRecv +2s read from 127.0.0.2:161: deadline +2s hook OnRetry +2s deadline +1s +2s hook PreSend +2s write #3: 2c "public" GetRequest id=1003 [.1.3.6.1.2.1.1.1.0] +2s agent answers #3 after 0s +2s hook OnSent +2s read from 127.0.0.2:161: 1 "public" Trap id=0 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"] +2s hook OnRecv +3s read from 127.0.0.2:161: deadline +3s hook OnRetry +3s result: packet nil, error "request timeout (after 2 retries)" *errors.errorString +3s client after: retries=2 next request id=1004 == requests/answer/wrong-id 0s client: 2c timeout=1s retries=2 exponential=false diff --git a/testdata/engine/v3.golden b/testdata/engine/v3.golden index fe530e1..121a36b 100644 --- a/testdata/engine/v3.golden +++ b/testdata/engine/v3.golden @@ -778,10 +778,19 @@ 0s hook OnSent 0s read from 127.0.0.2:161: 3 msgID=2002 authNoPriv+reportable user="codec-md5" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 context="\x80\x00\x1f\x88\x04codec-agent"/"" GetRequest id=1002 [.1.3.6.1.2.1.1.1.0] 0s hook OnRecv -0s hook OnFinish -0s result: packet 3 msgID=2002 authNoPriv+reportable GetRequest id=1002 context="\x80\x00\x1f\x88\x04codec-agent"/"" usm="codec-md5"/"\x80\x00\x1f\x88\x04codec-agent"/7/1000 [.1.3.6.1.2.1.1.1.0], no error -0s client after: engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 keys=current context engine="\x80\x00\x1f\x88\x04codec-agent" -0s known bug: the reply's PDU type is not checked: the client takes its own request, sent back unchanged, as the answer +1s read from 127.0.0.2:161: deadline +1s hook OnRetry +1s deadline +1s +1s hook PreSend +1s write #3: 3 msgID=2003 authNoPriv+reportable user="codec-md5" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 context="\x80\x00\x1f\x88\x04codec-agent"/"" GetRequest id=1003 [.1.3.6.1.2.1.1.1.0] +1s agent: answers #3 with GetResponse id=1003 msgID=2003 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"] at authNoPriv (request accepted) +1s agent answers #3 after 0s +1s hook OnSent +1s read from 127.0.0.2:161: 3 msgID=2003 authNoPriv user="codec-md5" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1001 context="\x80\x00\x1f\x88\x04codec-agent"/"" GetResponse id=1003 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"] +1s hook OnRecv +1s hook OnFinish +1s result: packet 3 msgID=2003 authNoPriv GetResponse id=1003 context="\x80\x00\x1f\x88\x04codec-agent"/"" usm="codec-md5"/"\x80\x00\x1f\x88\x04codec-agent"/7/1001 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"], no error +1s client after: engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1001 keys=current context engine="\x80\x00\x1f\x88\x04codec-agent" == v3/answer/reflected-request/md5-set 0s client: user="codec-md5" authNoPriv+reportable timeout=1s retries=2 @@ -802,10 +811,19 @@ 0s hook OnSent 0s read from 127.0.0.2:161: 3 msgID=2002 authNoPriv+reportable user="codec-md5" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 context="\x80\x00\x1f\x88\x04codec-agent"/"" SetRequest id=1002 [.1.3.6.1.2.1.1.1.0=OctetString:"codec"] 0s hook OnRecv -0s hook OnFinish -0s result: packet 3 msgID=2002 authNoPriv+reportable SetRequest id=1002 context="\x80\x00\x1f\x88\x04codec-agent"/"" usm="codec-md5"/"\x80\x00\x1f\x88\x04codec-agent"/7/1000 [.1.3.6.1.2.1.1.1.0=OctetString:"codec"], no error -0s client after: engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 keys=current context engine="\x80\x00\x1f\x88\x04codec-agent" -0s known bug: the reply's PDU type is not checked: the client takes its own request, sent back unchanged, as the answer +1s read from 127.0.0.2:161: deadline +1s hook OnRetry +1s deadline +1s +1s hook PreSend +1s write #3: 3 msgID=2003 authNoPriv+reportable user="codec-md5" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 context="\x80\x00\x1f\x88\x04codec-agent"/"" SetRequest id=1003 [.1.3.6.1.2.1.1.1.0=OctetString:"codec"] +1s agent: answers #3 with GetResponse id=1003 msgID=2003 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"] at authNoPriv (request accepted) +1s agent answers #3 after 0s +1s hook OnSent +1s read from 127.0.0.2:161: 3 msgID=2003 authNoPriv user="codec-md5" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1001 context="\x80\x00\x1f\x88\x04codec-agent"/"" GetResponse id=1003 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"] +1s hook OnRecv +1s hook OnFinish +1s result: packet 3 msgID=2003 authNoPriv GetResponse id=1003 context="\x80\x00\x1f\x88\x04codec-agent"/"" usm="codec-md5"/"\x80\x00\x1f\x88\x04codec-agent"/7/1001 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"], no error +1s client after: engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1001 keys=current context engine="\x80\x00\x1f\x88\x04codec-agent" == v3/answer/reflected-request/noauth 0s client: user="codec-noauth" noAuthNoPriv+reportable timeout=1s retries=2 @@ -826,10 +844,19 @@ 0s hook OnSent 0s read from 127.0.0.2:161: 3 msgID=2002 noAuthNoPriv+reportable user="codec-noauth" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 context="\x80\x00\x1f\x88\x04codec-agent"/"" GetRequest id=1002 [.1.3.6.1.2.1.1.1.0] 0s hook OnRecv -0s hook OnFinish -0s result: packet 3 msgID=2002 noAuthNoPriv+reportable GetRequest id=1002 context="\x80\x00\x1f\x88\x04codec-agent"/"" usm="codec-noauth"/"\x80\x00\x1f\x88\x04codec-agent"/7/1000 [.1.3.6.1.2.1.1.1.0], no error -0s client after: engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 keys=none context engine="\x80\x00\x1f\x88\x04codec-agent" -0s known bug: the reply's PDU type is not checked: the client takes its own request, sent back unchanged, as the answer +1s read from 127.0.0.2:161: deadline +1s hook OnRetry +1s deadline +1s +1s hook PreSend +1s write #3: 3 msgID=2003 noAuthNoPriv+reportable user="codec-noauth" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 context="\x80\x00\x1f\x88\x04codec-agent"/"" GetRequest id=1003 [.1.3.6.1.2.1.1.1.0] +1s agent: answers #3 with GetResponse id=1003 msgID=2003 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"] at noAuthNoPriv (request accepted) +1s agent answers #3 after 0s +1s hook OnSent +1s read from 127.0.0.2:161: 3 msgID=2003 noAuthNoPriv user="codec-noauth" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1001 context="\x80\x00\x1f\x88\x04codec-agent"/"" GetResponse id=1003 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"] +1s hook OnRecv +1s hook OnFinish +1s result: packet 3 msgID=2003 noAuthNoPriv GetResponse id=1003 context="\x80\x00\x1f\x88\x04codec-agent"/"" usm="codec-noauth"/"\x80\x00\x1f\x88\x04codec-agent"/7/1001 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"], no error +1s client after: engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1001 keys=none context engine="\x80\x00\x1f\x88\x04codec-agent" == v3/answer/reflected-request/sha-aes-set 0s client: user="codec-sha-aes" authPriv+reportable timeout=1s retries=2 @@ -851,10 +878,20 @@ 0s hook OnSent 0s read from 127.0.0.2:161: 3 msgID=2002 authPriv+reportable user="codec-sha-aes" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 salt=0000000000000102 encrypted 0s hook OnRecv -0s hook OnFinish -0s result: packet 3 msgID=2002 authPriv+reportable SetRequest id=1002 context="\x80\x00\x1f\x88\x04codec-agent"/"" usm="codec-sha-aes"/"\x80\x00\x1f\x88\x04codec-agent"/7/1000 [.1.3.6.1.2.1.1.1.0=OctetString:"codec"], no error -0s client after: engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 keys=current context engine="\x80\x00\x1f\x88\x04codec-agent" -0s known bug: the reply's PDU type is not checked: the client takes its own request, sent back unchanged, as the answer +1s read from 127.0.0.2:161: deadline +1s hook OnRetry +1s deadline +1s +1s hook PreSend +1s write #3: 3 msgID=2003 authPriv+reportable user="codec-sha-aes" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 salt=0000000000000103 encrypted +1s agent: #3 decrypts to context="\x80\x00\x1f\x88\x04codec-agent"/"" SetRequest id=1003 [.1.3.6.1.2.1.1.1.0=OctetString:"codec"] +1s agent: answers #3 with GetResponse id=1003 msgID=2003 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"] at authPriv (request accepted) +1s agent answers #3 after 0s +1s hook OnSent +1s read from 127.0.0.2:161: 3 msgID=2003 authPriv user="codec-sha-aes" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1001 salt=0000000000000001 encrypted +1s hook OnRecv +1s hook OnFinish +1s result: packet 3 msgID=2003 authPriv GetResponse id=1003 context="\x80\x00\x1f\x88\x04codec-agent"/"" usm="codec-sha-aes"/"\x80\x00\x1f\x88\x04codec-agent"/7/1001 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"], no error +1s client after: engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1001 keys=current context engine="\x80\x00\x1f\x88\x04codec-agent" == v3/answer/report-for-other-message 0s client: user="codec-noauth" noAuthNoPriv+reportable timeout=1s retries=2 @@ -932,10 +969,19 @@ 0s hook OnSent 0s read from 127.0.0.2:161: 3 msgID=2002 noAuthNoPriv user="codec-noauth" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 context="\x80\x00\x1f\x88\x04codec-agent"/"" Report id=1002 [.1.3.6.1.6.3.15.1.1.2.0=Counter32:1 .1.3.6.1.2.1.1.1.0=OctetString:"codec agent"] 0s hook OnRecv -0s hook OnFinish -0s result: packet 3 msgID=2002 noAuthNoPriv Report id=1002 context="\x80\x00\x1f\x88\x04codec-agent"/"" usm="codec-noauth"/"\x80\x00\x1f\x88\x04codec-agent"/7/1000 [.1.3.6.1.6.3.15.1.1.2.0=Counter32:1 .1.3.6.1.2.1.1.1.0=OctetString:"codec agent"], no error -0s client after: engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 keys=none context engine="\x80\x00\x1f\x88\x04codec-agent" -0s known bug: a Report with more than one varbind is returned as a successful reply +1s read from 127.0.0.2:161: deadline +1s hook OnRetry +1s deadline +1s +1s hook PreSend +1s write #3: 3 msgID=2003 noAuthNoPriv+reportable user="codec-noauth" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 context="\x80\x00\x1f\x88\x04codec-agent"/"" GetRequest id=1003 [.1.3.6.1.2.1.1.1.0] +1s agent: answers #3 with GetResponse id=1003 msgID=2003 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"] at noAuthNoPriv (request accepted) +1s agent answers #3 after 0s +1s hook OnSent +1s read from 127.0.0.2:161: 3 msgID=2003 noAuthNoPriv user="codec-noauth" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1001 context="\x80\x00\x1f\x88\x04codec-agent"/"" GetResponse id=1003 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"] +1s hook OnRecv +1s hook OnFinish +1s result: packet 3 msgID=2003 noAuthNoPriv GetResponse id=1003 context="\x80\x00\x1f\x88\x04codec-agent"/"" usm="codec-noauth"/"\x80\x00\x1f\x88\x04codec-agent"/7/1001 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"], no error +1s client after: engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1001 keys=none context engine="\x80\x00\x1f\x88\x04codec-agent" == v3/answer/report-two-varbinds-error-oid 0s client: user="codec-noauth" noAuthNoPriv+reportable timeout=1s retries=2 @@ -956,10 +1002,19 @@ 0s hook OnSent 0s read from 127.0.0.2:161: 3 msgID=2002 noAuthNoPriv user="codec-noauth" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 context="\x80\x00\x1f\x88\x04codec-agent"/"" Report id=1002 [.1.3.6.1.6.3.15.1.1.3.0=Counter32:1 .1.3.6.1.2.1.1.1.0=OctetString:"codec agent"] 0s hook OnRecv -0s hook OnFinish -0s result: packet 3 msgID=2002 noAuthNoPriv Report id=1002 context="\x80\x00\x1f\x88\x04codec-agent"/"" usm="codec-noauth"/"\x80\x00\x1f\x88\x04codec-agent"/7/1000 [.1.3.6.1.6.3.15.1.1.3.0=Counter32:1 .1.3.6.1.2.1.1.1.0=OctetString:"codec agent"], no error -0s client after: engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 keys=none context engine="\x80\x00\x1f\x88\x04codec-agent" -0s known bug: a Report with more than one varbind is returned as a successful reply +1s read from 127.0.0.2:161: deadline +1s hook OnRetry +1s deadline +1s +1s hook PreSend +1s write #3: 3 msgID=2003 noAuthNoPriv+reportable user="codec-noauth" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 context="\x80\x00\x1f\x88\x04codec-agent"/"" GetRequest id=1003 [.1.3.6.1.2.1.1.1.0] +1s agent: answers #3 with GetResponse id=1003 msgID=2003 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"] at noAuthNoPriv (request accepted) +1s agent answers #3 after 0s +1s hook OnSent +1s read from 127.0.0.2:161: 3 msgID=2003 noAuthNoPriv user="codec-noauth" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1001 context="\x80\x00\x1f\x88\x04codec-agent"/"" GetResponse id=1003 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"] +1s hook OnRecv +1s hook OnFinish +1s result: packet 3 msgID=2003 noAuthNoPriv GetResponse id=1003 context="\x80\x00\x1f\x88\x04codec-agent"/"" usm="codec-noauth"/"\x80\x00\x1f\x88\x04codec-agent"/7/1001 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"], no error +1s client after: engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1001 keys=none context engine="\x80\x00\x1f\x88\x04codec-agent" == v3/answer/unauthenticated 0s client: user="codec-md5" authNoPriv+reportable timeout=1s retries=2 From cab4fb9e4bd8c0aa1341451a077e9920e041ba4c Mon Sep 17 00:00:00 2001 From: ilyam8 Date: Sun, 11 Oct 2026 19:26:32 +0300 Subject: [PATCH 3/3] test: pin a discovery request sent back unchanged The discovery request carries no varbinds, so before the PDU-type check the empty-reply rule took it, reflected, as the discovery answer, and an authenticated request then failed for want of a key. It is read past now and the retry discovers the engine. --- engine_v3_test.go | 3 +++ testdata/engine/v3.golden | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/engine_v3_test.go b/engine_v3_test.go index bbfbc21..3c1bd9c 100644 --- a/engine_v3_test.go +++ b/engine_v3_test.go @@ -1002,6 +1002,9 @@ func v3Scenarios() map[string]v3Scenario { "answer/reflected-request/noauth": { user: "codec-noauth", script: onRequest(2, agentAnswer{reflect: true, why: "the request sent back"}), }, + "answer/reflected-request/discovery": { + user: "codec-md5", script: onRequest(1, agentAnswer{reflect: true, why: "the discovery request sent back"}), + }, "answer/reflected-request/md5": { user: "codec-md5", script: onRequest(2, agentAnswer{reflect: true, why: "the request sent back"}), }, diff --git a/testdata/engine/v3.golden b/testdata/engine/v3.golden index 121a36b..0da28ba 100644 --- a/testdata/engine/v3.golden +++ b/testdata/engine/v3.golden @@ -759,6 +759,39 @@ 0s result: packet 3 msgID=2003 authPriv GetResponse id=1003 context="\x80\x00\x1f\x88\x04codec-agent"/"" usm="codec-sha-aes"/"\x80\x00\x1f\x88\x04codec-agent"/7/1000 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"], no error 0s client after: engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1000 keys=current context engine="\x80\x00\x1f\x88\x04codec-agent" +== v3/answer/reflected-request/discovery +0s client: user="codec-md5" authNoPriv+reportable timeout=1s retries=2 +0s deadline +1s +0s hook PreSend +0s write #1: 3 msgID=2001 noAuthNoPriv+reportable user="" engine="" boots=0 time=0 context=""/"" GetRequest id=1001 [] +0s agent: reflects #1 unchanged (the discovery request sent back) +0s agent answers #1 after 0s +0s hook OnSent +0s read from 127.0.0.2:161: 3 msgID=2001 noAuthNoPriv+reportable user="" engine="" boots=0 time=0 context=""/"" GetRequest id=1001 [] +0s hook OnRecv +1s read from 127.0.0.2:161: deadline +1s hook OnRetry +1s deadline +1s +1s hook PreSend +1s write #2: 3 msgID=2002 noAuthNoPriv+reportable user="" engine="" boots=0 time=0 context=""/"" GetRequest id=1002 [] +1s agent: answers #2 with Report id=1002 msgID=2002 [.1.3.6.1.6.3.15.1.1.4.0=Counter32:1] at noAuthNoPriv (unknown engine ID) +1s agent answers #2 after 0s +1s hook OnSent +1s read from 127.0.0.2:161: 3 msgID=2002 noAuthNoPriv user="" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1001 context="\x80\x00\x1f\x88\x04codec-agent"/"" Report id=1002 [.1.3.6.1.6.3.15.1.1.4.0=Counter32:1] +1s hook OnRecv +1s hook OnFinish +1s deadline +1s +1s hook PreSend +1s write #3: 3 msgID=2003 authNoPriv+reportable user="codec-md5" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1001 context="\x80\x00\x1f\x88\x04codec-agent"/"" GetRequest id=1003 [.1.3.6.1.2.1.1.1.0] +1s agent: answers #3 with GetResponse id=1003 msgID=2003 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"] at authNoPriv (request accepted) +1s agent answers #3 after 0s +1s hook OnSent +1s read from 127.0.0.2:161: 3 msgID=2003 authNoPriv user="codec-md5" engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1001 context="\x80\x00\x1f\x88\x04codec-agent"/"" GetResponse id=1003 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"] +1s hook OnRecv +1s hook OnFinish +1s result: packet 3 msgID=2003 authNoPriv GetResponse id=1003 context="\x80\x00\x1f\x88\x04codec-agent"/"" usm="codec-md5"/"\x80\x00\x1f\x88\x04codec-agent"/7/1001 [.1.3.6.1.2.1.1.1.0=OctetString:"codec agent"], no error +1s client after: engine="\x80\x00\x1f\x88\x04codec-agent" boots=7 time=1001 keys=current context engine="\x80\x00\x1f\x88\x04codec-agent" + == v3/answer/reflected-request/md5 0s client: user="codec-md5" authNoPriv+reportable timeout=1s retries=2 0s deadline +1s