Bug 119106 - patch: ipAdEntIfIndex is wrong
Summary: patch: ipAdEntIfIndex is wrong
Alias: None
Product: Fedora
Classification: Fedora
Component: net-snmp (Show other bugs)
(Show other bugs)
Version: rawhide
Hardware: All Linux
Target Milestone: ---
Assignee: Phil Knirsch
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2004-03-25 03:31 UTC by Kaj J. Niemi
Modified: 2015-03-05 01:13 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-04-08 15:00:36 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
patch fixing ifIndex lookup problems for ipAdEntIfIndex (1.46 KB, patch)
2004-03-25 03:32 UTC, Kaj J. Niemi
no flags Details | Diff

Description Kaj J. Niemi 2004-03-25 03:31:00 UTC
Description of problem:
On Linux values ipAdEntIfIndex values for other than point
to the wrong IfIndex. 

The Attached patch fixes the problem mentioned above. It works okay on
both 2.4 and 2.6 kernels along with 1-4 physical interfaces besides lo0.

Since ipAddr.c pretty much blindly takes the ifreq->ifr_index value
coming filled by the kernel I guess the real problem might not be with
net-snmp. Once upon the someone had to write their own interface index
lookup routines in net-snmp for linux. My patch ignores both of these
(Address_Scan_Init() and Address_Scan_next()) and instead uses the
functions available for other operating systems, mostly *BSD I guess.
There is also a check to ignore addresses from 0/8 as interfaces
without an address get assigned

It took a while to reduce it to only a few lines of changes ;-)

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. snmpwalk -v 2c -c community host ifdescr
2. snmpwalk -v 2c -c community host ipadentifindex
Actual results:
ifDescr.1 = STRING: "lo"
ifDescr.2 = STRING: "eth0"
ifDescr.3 = STRING: "eth1"
ifDescr.4 = STRING: "sit0"
ipAdEntIfIndex. = INTEGER: 1
ipAdEntIfIndex. = INTEGER: 4
ipAdEntIfIndex. = INTEGER: 5

Expected results:
ifDescr.1 = STRING: "lo"
ifDescr.2 = STRING: "eth0"
ifDescr.3 = STRING: "eth1"
ifDescr.4 = STRING: "sit0"
ipAdEntIfIndex. = INTEGER: 1
ipAdEntIfIndex. = INTEGER: 2
ipAdEntIfIndex. = INTEGER: 3

Additional info:
RFC1213 states: "The index value which uniquely identifies the
interface to which this entry is applicable.  The interface identified
by a particular value of this index is the same interface as
identified by the same value of ifIndex."


Comment 1 Kaj J. Niemi 2004-03-25 03:32:10 UTC
Created attachment 98840 [details]
patch fixing ifIndex lookup problems for ipAdEntIfIndex

Comment 2 Kaj J. Niemi 2004-04-06 17:06:10 UTC
It would be good if this made FC2, too. :)

Comment 3 Phil Knirsch 2004-04-08 15:00:36 UTC
As always, good catch & thanks, Kaj!

There is another bug report open with the exact same problem, but i
hadn't had time to look at it closer yet, so i'm more than happy that
you found the problem.

Will include the patch in next net-snmp build.

Read ya, Phil

Note You need to log in before you can comment on or make changes to this bug.