Bug 1657848 - dhclient ignores given interface
Summary: dhclient ignores given interface
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: dhcp (Show other bugs)
(Show other bugs)
Version: 29
Hardware: x86_64 Linux
unspecified
high
Target Milestone: ---
Assignee: Pavel Zhukov
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-10 15:11 UTC by Jari Turkia
Modified: 2018-12-10 16:25 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Fix to enable functionality on dhclient to run on a given interface (421 bytes, patch)
2018-12-10 15:11 UTC, Jari Turkia
no flags Details | Diff

Description Jari Turkia 2018-12-10 15:11:34 UTC
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 62.248.219.2
DHCPREQUEST on enp3s0f0 to 255.255.255.255 port 67
DHCPOFFER from 84.249.192.3
DHCPACK from 84.249.192.3
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

How reproducible:
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

Actual results:
No working network.


Expected results:
Fully functional network.


Additional info:

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.


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