Commit 568e138f authored by Weibin Sun's avatar Weibin Sun

fix-bug: in snmpit_hp.pm:getUsedOpenflowListenerPorts the port may be...

fix-bug: in snmpit_hp.pm:getUsedOpenflowListenerPorts the port may be uninitialized if the listener string is empty. fix-bug: in snmpit.in:doEnableOpenflowListener Openflow listener output is printed out no matter whether the stacks support Openflow or not.
parent a6d06a47
......@@ -2646,6 +2646,8 @@ sub doEnableOpenflowListener($$) {
my %usedports = ();
my $port = $minOpenflowListenerPort;
my $errors = 0;
my $set_ok = 0;
my $listenerConnStr;
#
# get used ports
......@@ -2672,9 +2674,15 @@ sub doEnableOpenflowListener($$) {
#
# set listener
#
my $listenerConnStr = "ptcp:".$port;
print "Openflow listener connection string for VLAN $vlan is $listenerConnStr \n";
$errors += doSetOpenflowListener($stacks, $vlan, $listenerConnStr);
$listenerConnStr = "ptcp:".$port;
my $err = doSetOpenflowListener($stacks, $vlan, $listenerConnStr);
if ($err == 0 && $set_ok == 0) {
$set_ok = 1;
}
}
if ($set_ok) {
print "Openflow listener connection string for VLAN $vlan is $listenerConnStr \n";
}
ofunlock();
......
......@@ -1872,7 +1872,9 @@ sub getUsedOpenflowListenerPorts($) {
$self->debug("listener: $varname $vlan $connstr \n");
if ($varname =~ /$ofListenerVarNameMarker/) {
my ($proto, $port) = split(":", $connstr);
$ports{$port} = 1;
if (defined($port)){
$ports{$port} = 1;
}
#
# the SNMP session with MIB gives varname with strings not numbers, but
......
Markdown is supported
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