From owner-freebsd-net@FreeBSD.ORG Sat Jan 22 18:24:08 2011 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D69EF106564A for ; Sat, 22 Jan 2011 18:24:08 +0000 (UTC) (envelope-from egrosbein@rdtc.ru) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [62.231.161.221]) by mx1.freebsd.org (Postfix) with ESMTP id 44EF78FC12 for ; Sat, 22 Jan 2011 18:24:07 +0000 (UTC) Received: from eg.sd.rdtc.ru (localhost [127.0.0.1]) by eg.sd.rdtc.ru (8.14.4/8.14.4) with ESMTP id p0MIO5tk062163 for ; Sun, 23 Jan 2011 00:24:05 +0600 (NOVT) (envelope-from egrosbein@rdtc.ru) Message-ID: <4D3B20C0.8090907@rdtc.ru> Date: Sun, 23 Jan 2011 00:24:00 +0600 From: Eugene Grosbein User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; ru-RU; rv:1.9.2.13) Gecko/20110112 Thunderbird/3.1.7 MIME-Version: 1.0 To: "net@freebsd.org" Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Subject: bsnmpd: ifTable and if_nametoindex() inconsistency X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 18:24:08 -0000 Hi! I run 8.2-PRERELEASE with bsnmpd and mpd55 serving PPPoE users. I've noticed that sometimes snmpwalk shows interface indexes that partially differ from what if_nametoindex(3) returns with off-by-one or off-by-two. For example, just now this server has 813 connected PPPoE sessions (interfaces named ngXXXX) and SNMP returns wrong indexes for 567 out of them, starting from ng334. I've restarted bsnmpd but this made it worse: now all dynamic ngXXXX interfaces have obtained new indexes in SNMP ifTable and no one equals to if_nametoindex(name). Aren't these indexes supposed to be equal? I really need quick method to obtain SNMP index within mpd55 code (for my local mpd hacks) and if_nametoindex() used to seem nice way... I need to export indexes via mpd's web interface so that they may be checked remotely using SNMP. Eugene Grosbein