ports/97544: patch for zebra's ospfd snmp
dikshie
dikshie at lapi.itb.ac.id
Sun May 21 05:30:19 UTC 2006
>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 at 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:
More information about the freebsd-ports-bugs
mailing list