Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 May 2006 12:26:12 +0700 (WIT)
From:      dikshie <dikshie@lapi.itb.ac.id>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/97544: patch for zebra's ospfd snmp	
Message-ID:  <20060521052612.DFA711156A@ipv6.ppk.itb.ac.id>
Resent-Message-ID: <200605210530.k4L5UEG1022310@freefall.freebsd.org>

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

>Number:         97544
>Category:       ports
>Synopsis:       patch for zebra's ospfd snmp
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 21 05:30:13 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     dikshie
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
Institute of Technology Bandung, Indonesia	
>Environment:
System: FreeBSD ipv6.ppk.itb.ac.id 7.0-CURRENT FreeBSD 7.0-CURRENT #18: Sat Mar 25 18:00:22 WIT 2006 dikshie@ipv6.ppk.itb.ac.id:/usr/obj/usr/src/sys/PPK i386


>Description:

http://marc.theaimsgroup.com/?l=zebra&m=114806562624644&w=2



>How-To-Repeat:
>Fix:


--- zebra-ospfd-snmp-iftable-fix.patch begins here ---
Index: ospfd/ospf_snmp.c
===================================================================
RCS file: /cvsroot/zebra/ospfd/ospf_snmp.c,v
retrieving revision 1.33
diff -u -r1.33 ospf_snmp.c
--- ospfd/ospf_snmp.c	24 Nov 2004 10:03:06 -0000	1.33
+++ ospfd/ospf_snmp.c	19 May 2006 18:45:56 -0000
@@ -1680,8 +1680,27 @@
     return NULL;
 
   oi = ospf_if_lookup_by_local_addr (ospf, ifp, ifaddr);
-  if (oi == NULL)
-    return NULL;
+
+  if (exact)
+    {
+      if (oi == NULL)
+        return NULL;
+    }
+  else
+    {
+      while (oi == NULL)
+        {
+          /* Skip to the next interface. This is because, by simply
+             just returning, libsnmp will not preserve the matched ifp's
+             ifaddr and ifindex, and so it leads to just failing
+             on a first interface for every variables */
+          ifp = ospfIfLookup (v, name, length, &ifaddr, &ifindex, exact);
+          if (ifp == NULL)
+            return NULL;
+
+          oi = ospf_if_lookup_by_local_addr (ospf, ifp, ifaddr);
+        }
+    }
 
   /* Return the current value of the variable */
   switch (v->magic) 
@@ -1853,8 +1872,27 @@
     return NULL;
 
   oi = ospf_if_lookup_by_local_addr (ospf, ifp, ifaddr);
-  if (oi == NULL)
-    return NULL;
+
+  if (exact)
+    {
+      if (oi == NULL)
+        return NULL;
+    }
+  else
+    {
+      while (oi == NULL)
+        {
+          /* Skip to the next interface. This is because, by simply
+             just returning, libsnmp will not preserve the matched ifp's
+             ifaddr and ifindex, and so it leads to just failing
+             on a first interface for every variables */
+          ifp = ospfIfMetricLookup (v, name, length, &ifaddr, &ifindex, exact);
+          if (ifp == NULL)
+            return NULL;
+
+          oi = ospf_if_lookup_by_local_addr (ospf, ifp, ifaddr);
+        }
+    }
 
   /* Return the current value of the variable */
   switch (v->magic) 
--- zebra-ospfd-snmp-iftable-fix.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



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