diff options
author | emaste <emaste@FreeBSD.org> | 2018-04-10 23:38:31 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2018-04-10 23:38:31 +0000 |
commit | 19ba2e3bb164eebc4315e680d1807eb8dc70138e (patch) | |
tree | 5e64c8520f7b25ba321015bcae3e1763c96a8dd9 | |
parent | d0e8260dbc359b2b249cc34578d4e6b74f9baec1 (diff) | |
download | FreeBSD-src-19ba2e3bb164eebc4315e680d1807eb8dc70138e.zip FreeBSD-src-19ba2e3bb164eebc4315e680d1807eb8dc70138e.tar.gz |
MFC r308490 by syrinx:
Reply to a snmpEngineID discovery PDU with a Report PDU as per the
requirements of RFC 3414 section 4.
PR: 174974
Submitted by: pguyot@kallisys.net
-rw-r--r-- | contrib/bsnmp/lib/snmpagent.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/bsnmp/lib/snmpagent.c b/contrib/bsnmp/lib/snmpagent.c index 8393aec..b53770c 100644 --- a/contrib/bsnmp/lib/snmpagent.c +++ b/contrib/bsnmp/lib/snmpagent.c @@ -171,7 +171,10 @@ snmp_pdu_create_response(const struct snmp_pdu *pdu, struct snmp_pdu *resp) memset(resp, 0, sizeof(*resp)); strcpy(resp->community, pdu->community); resp->version = pdu->version; - resp->type = SNMP_PDU_RESPONSE; + if (pdu->flags & SNMP_MSG_AUTODISCOVER) + resp->type = SNMP_PDU_REPORT; /* RFC 3414.4 */ + else + resp->type = SNMP_PDU_RESPONSE; resp->request_id = pdu->request_id; resp->version = pdu->version; |