Bug 574568 - PERSISTENT_DHCLIENT=yes doesn't work when booting with eth0 phisically down
PERSISTENT_DHCLIENT=yes doesn't work when booting with eth0 phisically down
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: dhcp (Show other bugs)
12
All Linux
low Severity medium
: ---
: ---
Assigned To: Jiri Popelka
Fedora Extras Quality Assurance
:
: 637929 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-03-17 16:29 EDT by T-Gergely
Modified: 2010-11-01 16:48 EDT (History)
6 users (show)

See Also:
Fixed In Version: dhcp-4.2.0-12.fc14
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-11-01 16:48:18 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
flush addr and neigh instead of setting interface down (1.38 KB, patch)
2010-09-30 09:43 EDT, Sami Farin
no flags Details | Diff

  None (edit)
Description T-Gergely 2010-03-17 16:29:48 EDT
Description of problem:
When booting with a physically disconnected eth0, `/sbin/dhclient -q -lf /var/lib/dhclient/dhclient-eth0.leases -pf /var/run/dhclient-eth0.pid eth0` won't work until issuing `ip link set eth0 up`

Version-Release number of selected component (if applicable):
dhclient-4.1.0p1-5.fc11.i586
initscripts-8.95.1-1.i586
kernel-2.6.30.10-105.2.23.fc11.i586 (module forcedeth)

How reproducible:
Easily.

Steps to Reproduce:
1. ifdown eth0

2. Configure /etc/sysconfig/network-scripts/ifcg-eth0:
 DEVICE=eth0
 BOOTPROTO=dhcp
 ONBOOT=yes
 TYPE=Ethernet
 IPV6INIT=no
 PERSISTENT_DHCLIENT=yes

3. Boot (or ifup eth0) with eth hw switch turned off (or disconnect the eth cable).

4. After all the initscripts start, fix the physical eth connection, and see if eth0 ever gets up.
  
Actual results:
/var/log/messages in step 3:
Mar 17 20:41:00 greg klogd: eth0: no link during initialization.
Mar 17 20:41:00 greg dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 67
Mar 17 20:41:04 greg dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 67
Mar 17 20:41:14 greg dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
Mar 17 20:41:17 greg dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
Mar 17 20:41:20 greg dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
Mar 17 20:41:27 greg dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
Mar 17 20:41:35 greg dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 9
Mar 17 20:41:44 greg dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 11
Mar 17 20:41:55 greg dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 12
Mar 17 20:42:07 greg dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
Mar 17 20:42:15 greg dhclient: No DHCPOFFERS received.
Mar 17 20:42:15 greg dhclient: Trying recorded lease 192.168.99.16
Mar 17 20:42:18 greg dhclient: No working leases in persistent database - sleeping.
Mar 17 20:42:18 greg dhclient: receive_packet failed on eth0: Network is down

/var/log/messages in step 4:
Mar 17 20:49:22 greg dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
Mar 17 20:49:22 greg dhclient: send_packet: Network is down
Mar 17 20:49:28 greg dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 11
Mar 17 20:49:28 greg dhclient: send_packet: Network is down
Mar 17 20:49:39 greg dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 11
Mar 17 20:49:39 greg dhclient: send_packet: Network is down
Mar 17 20:49:50 greg dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 19
Mar 17 20:49:50 greg dhclient: send_packet: Network is down
Mar 17 20:50:09 greg dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 14
Mar 17 20:50:09 greg dhclient: send_packet: Network is down
Mar 17 20:50:23 greg dhclient: No DHCPOFFERS received.
Mar 17 20:50:23 greg dhclient: Trying recorded lease 192.168.99.16
Mar 17 20:50:26 greg dhclient: No working leases in persistent database - sleeping.


Expected results:
In step 4, eth0 should get up.

Additional info:
The following workaround works for me:
+++ ifup-eth	2010-03-17 21:19:21.000000000 +0100
@@ -215,6 +215,7 @@
 
     if /sbin/dhclient ${DHCLIENTARGS} ${DEVICE} ; then
 	echo $" done."
+        ip link set dev ${DEVICE} up
     else
 	echo $" failed."
 	exit 1
Comment 1 Bill Nottingham 2010-03-17 17:48:22 EDT
Given that initscripts isn't setting the link down, I believe that this is an issue with dhclient.
Comment 2 Jiri Popelka 2010-03-19 14:35:01 EDT
I tried this with Fedora-12 and it works for me.

Mar 19 19:10:14 nb-jirka kernel: ADDRCONF(NETDEV_UP): eth0: link is not ready
Mar 19 19:10:18 nb-jirka dhclient[3434]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5
Mar 19 19:10:23 nb-jirka dhclient[3434]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 12
Mar 19 19:10:35 nb-jirka dhclient[3434]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 16
Mar 19 19:10:51 nb-jirka dhclient[3434]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 20
Mar 19 19:11:25 nb-jirka kernel: tg3 0000:02:00.0: PME# enabled
Mar 19 19:12:13 nb-jirka kernel: tg3 0000:02:00.0: PME# disabled
Mar 19 19:12:13 nb-jirka kernel: ADDRCONF(NETDEV_UP): eth0: link is not ready
Mar 19 19:12:17 nb-jirka dhclient[3626]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
Mar 19 19:12:21 nb-jirka dhclient[3626]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5
Mar 19 19:12:26 nb-jirka dhclient[3626]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 12
Mar 19 19:12:38 nb-jirka dhclient[3626]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 15
Mar 19 19:12:53 nb-jirka dhclient[3626]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 20
Mar 19 19:13:13 nb-jirka dhclient[3626]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5
Mar 19 19:13:18 nb-jirka dhclient[3626]: No DHCPOFFERS received.
Mar 19 19:13:18 nb-jirka dhclient[3626]: No working leases in persistent database - sleeping.
Mar 19 19:17:56 nb-jirka kernel: tg3: eth0: Link is up at 100 Mbps, full duplex.
Mar 19 19:17:56 nb-jirka kernel: tg3: eth0: Flow control is on for TX and on for RX.
Mar 19 19:17:56 nb-jirka kernel: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Mar 19 19:19:48 nb-jirka dhclient[3651]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
Mar 19 19:19:54 nb-jirka dhclient[3651]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 13
Mar 19 19:19:54 nb-jirka dhclient[3651]: DHCPOFFER from 10.194.192.1
Mar 19 19:19:54 nb-jirka dhclient[3651]: DHCPREQUEST on eth0 to 255.255.255.255 port 67
Mar 19 19:19:54 nb-jirka dhclient[3651]: DHCPACK from 10.194.192.1
Mar 19 19:19:54 nb-jirka NET[3722]: /sbin/dhclient-script : updated /etc/resolv.conf
Mar 19 19:19:54 nb-jirka dhclient[3651]: bound to 89.102.16.18 -- renewal in 10664 seconds.
Comment 3 T-Gergely 2010-03-20 21:52:04 EDT
Thanks.

I've (pre)upgraded to Fedora 12, and it still fails.
I found the reason in /sbin/dhclient-script line 620: "ip -family inet link set ${interface} down".

I've noticed "tg3: eth0: Link is up at 100 Mbps, full duplex." in your log. That's good for you, but I don't think the poor forcedeth driver sends NETIF_MSG_IFUP or whatever is needed, so I can't let dhclient set my eth down.

(BTW, that default "retry 300" setting seems too much, so I had to set up a reasonable value in /etc/dhclient-eth0.conf.)
Comment 4 Bug Zapper 2010-04-28 07:58:10 EDT
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 5 T-Gergely 2010-08-24 18:29:00 EDT
This bug stayed with the updated package dhclient-4.1.1-18.P1.fc12.i686, so I had to patch /sbin/dhclient-script again.
Comment 6 Jiri Popelka 2010-09-30 07:18:22 EDT
*** Bug 637929 has been marked as a duplicate of this bug. ***
Comment 7 Jiri Popelka 2010-09-30 08:58:14 EDT
As I stated in comment #2, I'm not able to reproduce that on HW I have here.
But if you (T-Gergely, Sami) think the problem is in setting the link down we can
explicitly delete routes and clear arp cache instead because (according to comment in dhclient-script) that's the reason for setting the link down.

- ip link set ${interface} down
+ ip -4 route flush dev ${interface} >/dev/null 2>&1
+ ip -4 neigh flush dev ${interface} >/dev/null 2>&1
Comment 8 Sami Farin 2010-09-30 09:43:57 EDT
Created attachment 450758 [details]
flush addr and neigh instead of setting interface down

I removed that "ip link set ${interface} down" three days ago from my script and it has been working OK.  I use e1000e driver.

Now I applied the attached patch, unplugged the network cable, and ran dhclient.
Then I waited for "No working leases in persistent database - sleeping." and plugged the cable.
It acquired new IP address and interface did not go down.

You might want to tidy up the script so that those {addr,neigh} flushes are in a function (not repeated three times).
Comment 9 Fedora Update System 2010-10-13 07:10:59 EDT
dhcp-4.2.0-12.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/dhcp-4.2.0-12.fc14
Comment 10 Fedora Update System 2010-10-13 17:21:37 EDT
dhcp-4.2.0-12.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update dhcp'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/dhcp-4.2.0-12.fc14
Comment 11 Fedora Update System 2010-11-01 16:47:53 EDT
dhcp-4.2.0-12.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

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