Hi,

I used Net-SNMP 5.7.3 source and created an application that receives traps.
But when a V1 trap with IPV6 address in agent-addr field arrives,
sess_snmp_read() is dropping the packet due to parse error.
The following error is given:

*Bad parse of ASN.1 type (parse string length 16 too large: exceeds 4)*


I went through the code of net-snmp and figured out that agent address is
expected to be of size 4.

Below is the code snippet from snmp_api.c

        /*

         * agent-addr

         */

        four = 4;

        data = asn_parse_string(data, length, &type,

                                (u_char *) pdu->agent_addr, &four);

        if (data == NULL)

            return -1;

I want to know, how do we handle IPV6 address in agent-addr field, if
length is hard coded not to exceed 4?
Please let me know if this is a known issue and if we have any alternative
approach to solve this.

Thanking You,
Spandana Kadiri
------------------------------------------------------------------------------
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to