FS#36666 - [mkinitcpio-nfs-utils] ipconfig hangs on DHCP

Attached to Project: Arch Linux
Opened by Fedor Dostoyevskiy (bachtiar) - Sunday, 25 August 2013, 12:32 GMT
Last edited by Jelle van der Waa (jelly) - Monday, 18 September 2023, 17:46 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To Gerardo Exequiel Pozzi (djgera)
Christian Hesse (eworm)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No


ipconfig from mkinitcpio-nfs-utils hangs when obtaining IP address from DHCP on machine with two network cards.

As a result, one can not use machines with multiple network cards for diskless systems. Ouch.

Steps to reproduce:
1. put ipconfig on machine with two network cards
2. disconnect cable from eth0 and connect it to eth1 (or whatever the second interface is named)
3. start your favourite DHCP server somewhere on the network
4. ipconfig all

Technical elaboration:
"ipconfig all" (or for backward compatibility "ipconfig ip=dhcp") is supposed to bring up the first interface on which it receives a DHCP reply. However, due to misconfigured state machine in process_receive_event(main.c), it hangs in DHCPOFFER state and never finishes. The bug is triggered by connecting cable to eth1, because function do_pkt_recv iterates over interfaces in order they were found (eth0 first, eth1 second) and when it receives reply from DHCP server, it wrongfully assumes it's for eth0. Because the DHCP request was sent on eth1, the reply has different transaction ID from what eth0 would expect, so ipconfig drops the packet and gets stuck in DHCPOFFER state, from which it never recovers. Even adding timeout ("-t") does not help.

For proper operation, the state machine should assume that the replies coming from network can arrive in any order. So in fact the state machine should be driven by received packets and reaching to them instead of iterating through interface list.

In the other scenario (cable connected to eth0), ipconfig is similarily confused, but sometimes recovers after 10 minutes or so, typically when some Windows machine on the network broadcasts some UDP traffic, causing it to stop waiting and timeout.

The workaround is to use "ipconfig ethX" if you know which X will be connected (which I can not in advance).
This task depends upon

Closed by  Jelle van der Waa (jelly)
Monday, 18 September 2023, 17:46 GMT
Reason for closing:  Moved
Additional comments about closing:  https://gitlab.archlinux.org/archlinux/m kinitcpio/mkinitcpio-nfs-utils/issues/1
Comment by Fedor Dostoyevskiy (bachtiar) - Sunday, 25 August 2013, 13:05 GMT
I enabled debugging and added some dprintf calls. My lines are prefixed with #.
Comment by Dave Reisner (falconindy) - Sunday, 25 August 2013, 14:23 GMT
This is probably one of many bugs you'll be filing if you really do use mkinitcpio-nfs-utils.

The entire stack needs to be rewritten, and by someone who actually uses this stuff. There's no support for a proper dhcp client nor is there support for nfs4.
Comment by pat (patpat) - Friday, 01 August 2014, 17:21 GMT
this ipconfig issue is all over !
see: ipconfig bug filed at:

This bug prevents PXE booting also from single NIC card PCs because of a ipconfig DHCP protocol mistake.
I have tried to find the Arch sources of ipconfig but the packet mkinitcpio-nfs-utils 0.3-4 does not include its sources.

I have solved the problem patching and recompiling ipconfig from Ubuntu package klibc-utils under Ubuntu 12.04
With this version Arch archlinux-2014.06.01-dual.iso is able to PXE boot

See how and get the complementary INITRD_17.IMG containing the patched version here

Comment by Andreas Radke (AndyRTR) - Thursday, 28 July 2016, 11:52 GMT
Adding some more assigniees after this discussion:
Comment by Ceriel Jacobs (cj1) - Tuesday, 26 December 2017, 13:28 GMT
The source of mkinitcpio-nfs-utils its ipconfig is at <https://git.archlinux.org/mkinitcpio-nfs-utils.git/tree/ipconfig>

The ± 2003 version of ipconfig needs an update to 2014 a.k.a. klibc 2.0.4 <https://www.kernel.org/pub/linux/libs/klibc/2.0/> plus ubuntu dhcp bugfix <https://bugs.launchpad.net/ubuntu/+source/klibc/+bug/1327412>

Note: I only need ipconfig not the nfs stuff. Splitting mkinitcpio-nfs-utils in 2 separate packages where mkinitcpio-nfs depends on mkinitcpio-ipconfig would be welcome.
Comment by Buggy McBugFace (bugbot) - Tuesday, 08 August 2023, 19:11 GMT
This is an automated comment as this bug is open for more then 2 years. Please reply if you still experience this bug otherwise this issue will be closed after 1 month.