Bug 599633

Summary: libdhcp don't work if nics indexes are not uninterruptedly.
Product: Red Hat Enterprise Linux 5 Reporter: Alexander Malyarenko <alexander.malyarenko>
Component: libdhcpAssignee: David Cantrell <dcantrell>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: low    
Version: 5.5CC: atodorov, jstodola, khorenko
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libdhcp-1.20-12 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-21 05:34:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 726828    
Attachments:
Description Flags
change while(i<=nitems) to nl_cache_get_first and nl_cache_get_next none

Description Alexander Malyarenko 2010-06-03 16:34:38 UTC
Created attachment 419439 [details]
change while(i<=nitems) to nl_cache_get_first and nl_cache_get_next

Description of problem:
libdhcp don't work if nics indexes are not uninterruptedly. For example on my system I have, sit0 with index 1, lo with index 1, eth0 with index 4, but nic_get_links can't find my eth0 nic in this case.

# ./nl-tctree-dump
lo loopback 00:00:00:00:00:00 mtu 16436 <loopback,up,>
    txqlen 0 weight 0 qdisc noqueue index 2 brd 00:00:00:00:00:00
eth0 ether 00:0c:29:4e:64:53 mtu 1500 <broadcast,multicast,up,>
    txqlen 1000 weight 64 qdisc pfifo_fast index 4 brd ff:ff:ff:ff:ff:ff
  pfifo_fast qdisc dev eth0 handle none parent none bands 3
    refcnt 1 priomap [1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1]
              besteffort => 1                0x8 => 1
                  filler => 2                0x9 => 1
                    bulk => 2                0xa => 1
                     0x3 => 2                0xb => 1
        interactive_bulk => 1                0xc => 1
                     0x5 => 2                0xd => 1
             interactive => 0                0xe => 1
                 control => 0                0xf => 1
sit0 sit 0.0.0.0 mtu 1480 <noarp>
    txqlen 0 weight 0 qdisc noop index 1 brd 0.0.0.0

Attached patch fix this problem

Comment 1 Alexander Malyarenko 2010-06-03 16:50:21 UTC
I take libdhcp src.rpm from centos 5.5

Comment 5 RHEL Program Management 2011-08-05 12:29:57 UTC
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
release.

Comment 6 David Cantrell 2011-08-19 18:49:09 UTC
*** Bug 705301 has been marked as a duplicate of this bug. ***

Comment 8 Jan Stodola 2012-01-03 11:48:37 UTC
Reproduced on RHEL-5.7 (libdhcp-1.20-11.el5, nash-5.1.19.6-71.el5):

[root@gilliam ~]# cd /sys/class/net/
[root@gilliam net]# for i in *; do echo -n "$i: "; cat $i/ifindex; done
eth0: 4
lo: 1
sit0: 3
[root@gilliam net]# nash
(running in test mode).
Red Hat nash version 5.1.19.6 starting
network --device eth0 --bootproto dhcp
waiting for link... 0 seconds.
Sending request for IP information through eth0
nic_get_links (343): No such file or directory

nic_get_links (343): No such file or directory

nic_by_name: no interface named eth0 found
dhcp_nic: net_get_by_name(eth0) failed
ERROR: Interface setup failed: pumpSetupInterface failed: get link - 19: No such device.


Verified with libdhcp-1.20-13.el5 and nash-5.1.19.6-75.el5:

[root@gilliam ~]# cd /sys/class/net/
[root@gilliam net]# for i in *; do echo -n "$i: "; cat $i/ifindex; done
eth0: 4
lo: 1
sit0: 3
[root@gilliam net]# nash
(running in test mode).
Red Hat nash version 5.1.19.6 starting
network --device eth0 --bootproto dhcp
waiting for link... 0 seconds.
Sending request for IP information through eth0
Listening on LPF/eth0/00:1c:c4:12:fc:30
Sending on   LPF/eth0/00:1c:c4:12:fc:30
Sending on   Socket/fallback
DHCPREQUEST on eth0 to 255.255.255.255 port 67 (xid=0x3b7c8a44)
DHCPREQUEST on eth0 to 255.255.255.255 port 67 (xid=0x3b7c8a44)
DHCPACK from 10.10.36.113 (xid=0x3b7c8a44)
bound to 10.10.9.126 -- renewal in 42906 seconds.
DHCPv4 eth0 - obtained lease 10.10.9.126
DHCPv4 eth0 - option subnet-mask: 255.255.252.0
DHCPv4 eth0 - option subnet-mask - prefix_len: 22 broadcast: 10.10.11.255
DHCPv4 eth0 - option routers:
[root@gilliam net]#


Moving to VERIFIED.

Comment 9 errata-xmlrpc 2012-02-21 05:34:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0193.html