Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 756759

Summary: dhclient retries on DHCPDECLINE despite -1 option
Product: Red Hat Enterprise Linux 6 Reporter: Jiri Popelka <jpopelka>
Component: dhcpAssignee: Jiri Popelka <jpopelka>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: hannsj_uhl, jnevill, ljozsa, mganisin, ovasik
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: dhcp-4.1.1-27.P1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 756490 Environment:
Last Closed: 2012-06-20 12:43:46 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: 756490    
Bug Blocks: 1311427    
Attachments:
Description Flags
Send DHCPDECLINE and exit(2) when duplicate address has been detected and dhclient was started with '-1'. none

Description Jiri Popelka 2011-11-24 13:13:24 UTC
+++ This bug was initially created as a clone of Bug #756490 +++

Description of problem:
When dhclient is invoked with the "-1" command line option, and then issues a DHCPDECLINE message it continues to try to obtain a lease. Despite the fact that "-1" should "Try to get a lease once. On failure exit with code 2." (from man page)


Version-Release number of selected component (if applicable):
dhclient-3.0.5-21.el5


How reproducible:
Consistently at customer


Steps to Reproduce:
1. Configure a DHCP server to hand out an IP address to clientA.
2. Statically configure clientB with that same IP address.
3. Run 'dhclient -1 -cf /tmp/dhcp.conf -pf /var/run/dhclient.pid -lf /var/lib/dhclient/dhclient.leases eth0' on clientA.
  

Actual results:
ClientA detects the duplicate IP address, issues a DHCPDECLINE message, and then continues to try and get a new IP address over and over again, despite the "-1" command line option.


Expected results:
ClientA detects the duplicate IP address, issues a DHCPDECLINE message, and then stops trying to obtain a lease.

Comment 1 Jiri Popelka 2011-11-24 13:14:44 UTC
Created attachment 535897 [details]
Send DHCPDECLINE and exit(2) when duplicate address has been detected and dhclient was started with '-1'.

Comment 5 Ladislav Jozsa 2012-04-18 19:33:33 UTC
It doesn't seem that dhclient DAD's working in dhclient-3.0.5-31.el5, thus I'm unable to reproduce if the dhclient behaves correctly.


Here's what I tried on RHEL5.9-Server-20120417.1.n, dhclient-.0.5-31.el5.x86_64:

# ip a s dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 52:54:00:63:02:ab brd ff:ff:ff:ff:ff:ff

# dhclient -1 -pf /var/run/dhclient.pid -lf /var/lib/dhclient/dhclient.leases eth0

Internet Systems Consortium DHCP Client V3.0.5-RedHat
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

Listening on LPF/eth0/52:54:00:63:02:ab
Sending on   LPF/eth0/52:54:00:63:02:ab
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5 (xid=0x68886723)
DHCPOFFER from 192.168.1.40
DHCPREQUEST on eth0 to 255.255.255.255 port 67 (xid=0x68886723)
DHCPACK from 192.168.1.40 (xid=0x68886723)
bound to 192.168.1.1 -- renewal in 299 seconds.

And output from tcpdump running on the client that ran the dhclient:

# tcpdump -s0 -vvvni eth0 udp port 67 or udp port 68 or arp
tcpdump: WARNING: eth0: no IPv4 address assigned
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
15:27:42.321853 IP (tos 0x10, ttl  16, id 0, offset 0, flags [none], proto: UDP (17), length: 328) 0.0.0.0.bootpc > 255.255.255.255.bootps: [udp sum ok] BOOTP/DHCP, Request from 52:54:00:63:02:ab, length: 300, xid:0x23678868, flags: [none] (0x0000)
          Client Ethernet Address: 52:54:00:63:02:ab
          Vendor-rfc1048:
            DHCP:DISCOVER
            RQ:192.168.1.1
            PR:SM+BR+TZ+DG+DN+NS+HN+YD+YS+NTP+MTU
15:27:42.322348 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto: UDP (17), length: 328) 192.168.1.40.bootps > 192.168.1.1.bootpc: [udp sum ok] BOOTP/DHCP, Reply, length: 300, xid:0x23678868, flags: [none] (0x0000)
          Your IP: 192.168.1.1
          Client Ethernet Address: 52:54:00:63:02:ab
          Vendor-rfc1048:
            DHCP:OFFER
            SID:192.168.1.40
            LT:600
            SM:255.255.255.0
            DN:"example.org"
            NS:10.34.255.7,10.34.255.6
15:27:42.323497 IP (tos 0x10, ttl  16, id 0, offset 0, flags [none], proto: UDP (17), length: 328) 0.0.0.0.bootpc > 255.255.255.255.bootps: [udp sum ok] BOOTP/DHCP, Request from 52:54:00:63:02:ab, length: 300, xid:0x23678868, flags: [none] (0x0000)
          Client Ethernet Address: 52:54:00:63:02:ab
          Vendor-rfc1048:
            DHCP:REQUEST
            SID:192.168.1.40
            RQ:192.168.1.1
            PR:SM+BR+TZ+DG+DN+NS+HN+YD+YS+NTP+MTU
15:27:42.324905 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto: UDP (17), length: 328) 192.168.1.40.bootps > 192.168.1.1.bootpc: [udp sum ok] BOOTP/DHCP, Reply, length: 300, xid:0x23678868, flags: [none] (0x0000)
          Your IP: 192.168.1.1
          Client Ethernet Address: 52:54:00:63:02:ab
          Vendor-rfc1048:
            DHCP:ACK
            SID:192.168.1.40
            LT:600
            SM:255.255.255.0
            DN:"example.org"
            NS:10.34.255.7,10.34.255.6

Aside from this, notice different xid in UDP packets and xid reported by dhclient itself.

Comment 6 Ladislav Jozsa 2012-04-19 16:57:29 UTC
Please scratch the comment #5. The issue was originally reported for version 3.x of dhclient which is part of RHEL5 and I thought that 3.x is what needs to be tested.

I have re-verified it on RHEL6.3-20120411.1, dhclient-4.1.1-30.P1.el6. Actual behaviour is correct, dhclient detects that IP address is in use and sends DHCPDECLINE and exits with code 2.

Comment 10 errata-xmlrpc 2012-06-20 12:43:46 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-0793.html