Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Apr 2007 15:28:43 -0500 (CDT)
From:      rubin@physics.umn.edu
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/111491: net-snmp's bulkwalk perl call is broken 
Message-ID:  <200704112028.l3BKShcc004500@mrmachenry.spa.umn.edu>
Resent-Message-ID: <200704112110.l3BLA2RB009787@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         111491
>Category:       ports
>Synopsis:       net-snmp's bulkwalk perl call is broken
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 11 21:10:02 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Alex Schumann
>Release:        FreeBSD 6.1-RELEASE-p14 i386
>Organization:
UofMN Physics
>Environment:
System: FreeBSD hostname 6.1-RELEASE-p14 FreeBSD 6.1-RELEASE-p14 #15: Thu Feb 15 16:38:50 CST 2007 root@hostname:/usr/obj/usr/src/sys/PHYS i386


	
>Description:
	
When calling SNMP::bulkwalk via SNMP::Session, bulkwalk returns its own parameters (@_) instead of the results of the walk. This was fixed upstream several months ago, but I think a backport of the (simple) patch is warranted because bulkwalk is unusable in the current ports state.
>How-To-Repeat:
	
To reproduce, run the following perl script against an snmp capable switch:
#!/usr/local/bin/perl
#

use SNMP;
use Data::Dumper;

$s1 = new SNMP::Session (
      'DestHost'        => "some-switch",
      'Community'       => "public",
      'Version'         => "2c",
      'UseNumeric'      => 1,
      'UseEnum'         => 0,
      'UseLongNames'    => 1
      );

die("Session failed") unless defined($s1);

$vars = new SNMP::VarList ( ['sysUpTime'], ['ifNumber'], # NON-repeaters
                            ['ifSpeed'], ['ifDescr']);   # Repeated variables.

@list = $s1->bulkwalk(2,16, $vars);

die("Failed to bulkwalk") unless ($s1->{ErrorNum} == 0);


# When the bug is hapning, This will fail with a 
# runtime error because @list is not the array
# expected:
if(defined($list[0][0])) {
    print $list[0][0]->tag . " \n";
}
else {
  die("No list");
}

print "Done\n\n";

>Fix:
To fix, apply the simple patch committed to the net-snmp SVN Sep 8 2006 3:43:32 by hardaker
http://net-snmp.svn.sourceforge.net/viewvc/net-snmp?view=rev&revision=15175
http://net-snmp.svn.sourceforge.net/viewvc/net-snmp/trunk/net-snmp/perl/SNMP/SNMP.xs?r1=15113&r2=15175&view=patch

I tested it here by applying to tho work directory for net-snmp-5.3.1_3, and it solved the problem.


Thanks for your time,
  -Alex
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200704112028.l3BKShcc004500>