NeDi Community

NeDi Software Specific => Discovery => Topic started by: pluto01 on April 19, 2012, 10:47:53 PM

Title: Bug in 1.0.7 CDP discovery on CatOS devices
Post by: pluto01 on April 19, 2012, 10:47:53 PM
There looks like a bug in CDP discovery in 1.0.7. It looks like this code bit was put in as a fix for Nexus devices which were having the opposite problem in the beta. I think the patch is appropriate, just a } in the wrong place. It seems to fix the problem for me.  ;D

-Brian

Code: [Select]
--- libsnmp.pm.dist     Wed Apr 18 13:52:13 2012
+++ libsnmp.pm  Thu Apr 19 14:53:45 2012
@@ -1415,7 +1415,7 @@
                                        my $nebid = &misc::Strip($val);
                                        $neb{$k[14]}{$k[15]}{'id'} = $nebid;
                                        $neb{$k[14]}{$k[15]}{'na'} = $nebid;
-                                       if($lneb{"1.3.6.1.4.1.9.9.23.1.2.1.1.8.$k[14].$k[15]" =~ /^WS-C/}){
+                                       if($lneb{"1.3.6.1.4.1.9.9.23.1.2.1.1.8.$k[14].$k[15]"} =~ /^WS-C/){
                                                $neb{$k[14]}{$k[15]}{'na'} =~ s/(.*?)\((.*?)\)/$2/;                     # Extract from CatOS
                                        }else{
                                                $neb{$k[14]}{$k[15]}{'na'} =~ s/(.*?)\((.*?)\)/$1/;                     # Extract from other (e.g. NxK)
Title: Re: Bug in 1.0.7 CDP discovery on CatOS devices
Post by: rickli on April 20, 2012, 06:27:59 PM
Oops, definitely lousy code  ??? Thanks!
Title: Re: Bug in 1.0.7 CDP discovery on CatOS devices
Post by: ablkshrt1 on May 07, 2012, 10:50:39 PM
So is the above quoted code correct or incorrect.  I am not a programmer, so I wouldn't know what I was looking at.
Title: Re: Bug in 1.0.7 CDP discovery on CatOS devices
Post by: rickli on May 09, 2012, 09:42:16 PM
You seem to be on the right path ;-)

http://forum.nedi.ch/index.php?topic=1250.msg4820#msg4820