Bug 458937 - net-smp fails to parse if_inet6 when the iface index is greater than 255
net-smp fails to parse if_inet6 when the iface index is greater than 255
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: net-snmp (Show other bugs)
All Linux
medium Severity medium
: rc
: ---
Assigned To: Jan Safranek
Depends On:
  Show dependency treegraph
Reported: 2008-08-13 07:07 EDT by Olivier Fourdan
Modified: 2017-01-30 04:26 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-01-20 17:07:28 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch to increase the lengths of the index in sscanf (622 bytes, patch)
2008-08-13 07:07 EDT, Olivier Fourdan
no flags Details | Diff

  None (edit)
Description Olivier Fourdan 2008-08-13 07:07:47 EDT
Created attachment 314189 [details]
Patch to increase the lengths of the index in sscanf

Description of problem:

With a large number of interfaces (like in a Xen environments with multiple xen bridges), the index of the interfaces can be greater than 255. In such a case, net-snmp will fails to parse /proc/net/if_inet6 if one of the index is greater than 0xFF and will generate errors.

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


How reproducible:

100% reproducible

Steps to Reproduce:

1.Set-up an system with a lot of network interfaces
2.Check if one of the interfaces in proc/net/if_inet6 has an index greater than 0xFF
3.Install and configure net-snmp
Actual results:

snmpd[13835]: ioctl 35123 returned -1 
last message repeated <many> times

Expected results:

No error message

Additional info:

The parsing is done in _load_v6() (in agent/mibgroup/ip-mib/data_access/ipaddress_linux.c) with:

         * fe800000000000000200e8fffe5b5c93 05 40 20 80 eth0
         *             A                    D  P  S  F  I
         * A: address
         * D: device number
         * P: prefix len
         * S: scope (see include/net/ipv6.h, net/ipv6/addrconf.c)
         * F: flags (see include/linux/rtnetlink.h, net/ipv6/addrconf.c)
         * I: interface
        rc = sscanf(line, "%39s %02x %02x %02x %02x %8s\n",
                    addr, &if_index, &pfx_len, &scope, &flags, if_name);

So if the index is greater than 0xFF, scanf %02x will not read the entire index and break the pasing of the remaining items.
Comment 3 RHEL Product and Program Management 2008-08-13 07:41:47 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
Comment 4 Martin Kočí 2008-08-13 08:23:18 EDT
QA acked for 5.3.
Comment 8 errata-xmlrpc 2009-01-20 17:07:28 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


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