--- AnyEvent-SNMP/SNMP.pm 2014/11/24 18:16:54 1.13 +++ AnyEvent-SNMP/SNMP.pm 2019/10/09 18:22:59 1.14 @@ -154,7 +154,7 @@ use Net::SNMP (); use AnyEvent (); -our $VERSION = '6.0'; +our $VERSION = '6.02'; $Net::SNMP::DISPATCHER = instance Net::SNMP::Dispatcher; @@ -259,7 +259,11 @@ $msg->error ($MESSAGE_PROCESSING->error) if $MESSAGE_PROCESSING->error; # Notify the command generator to process the response. - $msg->process_response_pdu; + # Net::SNMP calls process_response_pdu, which simply calls callback_execute, + # but some errors cause $msg to be of type Net::SNMP::Message, not Net::SMMP::PDU, + # so we call the underlying callback_execute method which exists on both and + # seems to do the right thing. + $msg->callback_execute; # Cancel the timeout. my $rtimeout_w = $msg->timeout_id;