Commit a3e55dbf authored by Weibin Sun's avatar Weibin Sun
Browse files

fix bug: in snmpit_hp module, the SNMP session with MIB returns the OID as...

fix bug: in snmpit_hp module, the SNMP session with MIB returns the OID as strings not numbers even for Openflow entry, however, the meaningful string OID cannot be used to get the next entry in MIB table! So getUsedOpenflowListenerPorts has to modify the OID of the current entry to be the numbered format.
parent 43d4f2aa
......@@ -2509,6 +2509,8 @@ sub doTrunkDisable($$) {
#
# Openflow lock and functions
#
use libtestbed;
my $of_lock_held = 0;
sub oflock() {
......@@ -2646,7 +2648,7 @@ sub doEnableOpenflowListener($$) {
my $stacks = shift;
my $vlan = shift;
my %ports = ();
my %usedports = ();
my $port = $minOpenflowListenerPort;
my $errors = 0;
......@@ -2659,11 +2661,11 @@ sub doEnableOpenflowListener($$) {
#
oflock();
foreach my $stack (@$stacks) {
$stack->getUsedOpenflowListenerPorts(\%ports);
$stack->getUsedOpenflowListenerPorts(\%usedports);
}
# get the available port
while (defined($ports{$port}) && $port <= $maxOpenflowListenerPort) {
while (defined($usedports{$port}) && $port <= $maxOpenflowListenerPort) {
$port++;
}
......
......@@ -1870,8 +1870,18 @@ sub getUsedOpenflowListenerPorts($$) {
if ($varname =~ /$ofListenerVarNameMarker/) {
my ($proto, $port) = split(":", $connstr);
$ports->{$port} = 1;
}
$self->{SESS}->getnext($listener);
#
# the SNMP session with MIB gives varname with strings not numbers, but
# the string names can't be used to get the next entry in table! So we
# have to use the numbered OID. To get the next entry, we must
# append the current instance ID, which is the last section of the dotted
# varname, to the numbered OID.
#
my $lastdot = rindex($varname, '.');
$listener->[0] = $ofListenerOID.".".substr($varname, $lastdot+1);
$self->{SESS}->getnext($listener);
}
} while ($varname =~ /$ofListenerVarNameMarker/);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment