Download | Plain Text | No Line Numbers


  1. diff -Naur a/lib/Net/SNMP.pm b/lib/Net/SNMP.pm
  2. --- a/lib/Net/SNMP.pm 2011-12-24 00:41:27.000000000 +0100
  3. +++ b/lib/Net/SNMP.pm 2012-02-21 13:17:04.000000000 +0100
  4. @@ -2564,7 +2564,7 @@
  5.  
  6. if ($this->{_security}->discovered()) {
  7. DEBUG_INFO('discovery complete');
  8. - return $this->_discovery_complete();
  9. + $this->_discovery_complete();
  10. }
  11.  
  12. # "If authenticated communication is required, then the discovery
  13. @@ -2618,7 +2618,7 @@
  14. # assume that the synchronization has failed.
  15.  
  16. if (($this->{_security}->discovered()) &&
  17. - ($this->{_error} =~ /usmStatsNotInTimeWindows/))
  18. + ((!$this->{_error}) || ($this->{_error} =~ /usmStatsNotInTimeWindows/)))
  19. {
  20. $this->_error_clear();
  21. DEBUG_INFO('discovery and synchronization complete');
  22. diff -Naur a/lib/Net/SNMP/Security/USM.pm b/lib/Net/SNMP/Security/USM.pm
  23. --- a/lib/Net/SNMP/Security/USM.pm 2011-12-24 00:41:27.000000000 +0100
  24. +++ b/lib/Net/SNMP/Security/USM.pm 2012-02-21 13:20:47.000000000 +0100
  25. @@ -471,6 +471,16 @@
  26. );
  27. }
  28.  
  29. + # Synchronize the time
  30. + if (!$this->_synchronize($msg_engine_boots, $msg_engine_time)) {
  31. + return $this->_error();
  32. + }
  33. +
  34. + # Check for timeliness
  35. + if (!defined $this->_timeliness($msg_engine_boots, $msg_engine_time)) {
  36. + return $this->_error();
  37. + }
  38. +
  39. if ($security_level > SECURITY_LEVEL_NOAUTHNOPRIV) {
  40.  
  41. # Authenticate the message
  42. @@ -478,16 +488,6 @@
  43. return $this->_error();
  44. }
  45.  
  46. - # Synchronize the time
  47. - if (!$this->_synchronize($msg_engine_boots, $msg_engine_time)) {
  48. - return $this->_error();
  49. - }
  50. -
  51. - # Check for timeliness
  52. - if (!defined $this->_timeliness($msg_engine_boots, $msg_engine_time)) {
  53. - return $this->_error();
  54. - }
  55. -
  56. if ($security_level > SECURITY_LEVEL_AUTHNOPRIV) {
  57.  
  58. # Validate the msgPrivacyParameters length.
  59.