From owner-freebsd-ports-bugs@FreeBSD.ORG Sun May 21 05:30:19 2006 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A833516A428 for ; Sun, 21 May 2006 05:30:19 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id C1B4743D55 for ; Sun, 21 May 2006 05:30:14 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k4L5UElP022311 for ; Sun, 21 May 2006 05:30:14 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k4L5UEG1022310; Sun, 21 May 2006 05:30:14 GMT (envelope-from gnats) Resent-Date: Sun, 21 May 2006 05:30:14 GMT Resent-Message-Id: <200605210530.k4L5UEG1022310@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, dikshie Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E140316A420 for ; Sun, 21 May 2006 05:26:27 +0000 (UTC) (envelope-from dikshie@ipv6.ppk.itb.ac.id) Received: from mx1.itb.ac.id (mx1.ITB.ac.id [167.205.23.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id D200043D45 for ; Sun, 21 May 2006 05:26:26 +0000 (GMT) (envelope-from dikshie@ipv6.ppk.itb.ac.id) Received: from mx4.ITB.ac.id (mx4.itb.ac.id [IPv6:2001:d30:3:5::69]) by mx1.itb.ac.id (Postfix) with ESMTP id C1F48F7F6F for ; Sun, 21 May 2006 12:25:25 +0700 (WIT) Received: from localhost (antivirus.itb.ac.id [167.205.1.75]) by mx4.ITB.ac.id (Postfix) with ESMTP id AB42B4AC22 for ; Sun, 21 May 2006 12:25:38 +0700 (WIT) Received: from mx4.ITB.ac.id ([167.205.1.69]) by localhost (antivirus.itb.ac.id [167.205.1.75]) (amavisd-new, port 10004) with ESMTP id 36523-06 for ; Sun, 21 May 2006 12:26:54 +0000 (UTC) Received: from ipv6.ppk.itb.ac.id (ipv6.ppk.itb.ac.id [167.205.30.228]) by mx4.ITB.ac.id (Postfix) with ESMTP id A30774AC25 for ; Sun, 21 May 2006 12:25:34 +0700 (WIT) Received: by ipv6.ppk.itb.ac.id (Postfix, from userid 1001) id DFA711156A; Sun, 21 May 2006 12:26:12 +0700 (WIT) Message-Id: <20060521052612.DFA711156A@ipv6.ppk.itb.ac.id> Date: Sun, 21 May 2006 12:26:12 +0700 (WIT) From: dikshie To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/97544: patch for zebra's ospfd snmp X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dikshie List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 May 2006 05:30:19 -0000 >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: