Created attachment 1513100 [details]
Fix to enable functionality on dhclient to run on a given interface
Description of problem:
When networking is using classic interface management (network-scripts.rpm) and when an interface is configured to use DHCP as bootproto, it will execute dhclient with a command-line similar to this:
/sbin/dhclient -1 -q -lf /var/lib/dhclient/dhclient--eno1.lease -pf /run/dhclient-eno1.pid -H myPCame eno1
When same command-line is run without -q and -d added, output will contain:
Listening on LPF/enp3s0f1/90:e2:ba:00:00:01
Sending on LPF/enp3s0f1/90:e2:ba:00:00:01
Listening on LPF/eno1/60:a4:4c:00:00:01
Sending on LPF/eno1/60:a4:4c:00:00:01
Listening on LPF/enp3s0f0/90:e2:ba:00:00:02
Sending on LPF/enp3s0f0/90:e2:ba:00:00:02
Sending on Socket/fallback
This list is obviously not what was intended. There should be a single network interface listed (eno1). As an expected fallout of this issue, following happens:
DHCPDISCOVER on enp3s0f1 to 255.255.255.255 port 67 interval 3
DHCPREQUEST on eno1 to 255.255.255.255 port 67
DHCPDISCOVER on enp3s0f0 to 255.255.255.255 port 67 interval 5
DHCPACK from 126.96.36.199
DHCPREQUEST on enp3s0f0 to 255.255.255.255 port 67
DHCPOFFER from 188.8.131.52
DHCPACK from 184.108.40.206
DHCPDISCOVER on enp3s0f1 to 255.255.255.255 port 67 interval
All detected interfaces start DHCP negotiation. Since command similar to this is run for each configured interface, a complete disaster happens. Ultimately no interface will retain a negotiated IP-address, if they succeed in negotiating one.
Version-Release number of selected component (if applicable):
Name : dhcp-client
Epoch : 12
Version : 4.3.6
Release : 28.fc29
Arch : x86_64
Easily, run dhclient on an machine having more than one network interface.
Steps to Reproduce:
1. Remove NetworkManager, install network-scripts
2. ifup <an interface>
3. Observe no IP-address available
No working network.
Fully functional network.
A patch exists. In client/dhclient.c code discover_interfaces() is called to detect available interfaces. All suitable interfaces are flagged as INTERFACE_AUTOMATIC and DISCOVER_REQUESTED. Later send/receive code is run for all interfaces flagged as DISCOVER_REQUESTED. The below patch breaks user input logic of running DHCP-client on all interfaces if none is specified. However, it fixes the logic on specified interface making network-scripts work again.