Bug 1358427

Summary: dhcp errors with hostnames beginning with numbers
Product: Red Hat Enterprise Linux 7 Reporter: Casey Carson <casey.carson>
Component: dnsmasqAssignee: Pavel Šimerda (pavlix) <psimerda>
Status: CLOSED ERRATA QA Contact: Vaclav Danek <vdanek>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7.0CC: fkrska, jscotka, lmiksik, mjahoda, ovasik, tcleveng, thozza, vdanek
Target Milestone: rcKeywords: Patch, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Previously, dnsmasq incorrectly read host names using the "--dhcp-hostsfile" and "--dhcp-host" options that began with numbers. As a consequence, hosts with numbers at the beginning of the host name did not receive a lease, and dnsmasq logged the "no address available" error. With this update, dnsmasq reads host names correctly, and DHCP errors with host names that begin with numbers no longer occur.
Story Points: ---
Clone Of:
: 1371460 (view as bug list) Environment:
Last Closed: 2016-11-04 06:14:56 UTC Type: Bug
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:    
Bug Blocks: 1371460    

Description Casey Carson 2016-07-20 16:12:30 UTC
Description of problem:

dnsmasq contains a bug where hostnames that begin with numbers inside the dhcp-hostsfile are not honored and are logged as "bad DHCP host name at line X"

This has been fixed upstream to be in accordance with RFC 1123 (see http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2013q3/007369.html)

Version-Release number of selected component (if applicable):

Name        : dnsmasq
Version     : 2.66
Release     : 14.el7_1
Architecture: x86_64

How reproducible: Always

Steps to Reproduce:
1. Add a host entry in the dnsmasq dhcp-host file where the name begins with a number, e.g.

fa:16:3e:2e:8c:2a,07bc483fe-c864-4d2d-8c8d-355943c20e08.mydomain.com.,10.254.0.4

2. Start dnsmasq

Actual results:

Error is logged as "bad DHCP host name at line"
host with associated mac address cannot receive a lease, dnsmasq logs error "no address available"

Expected results:

File is read without errors, dhcp requests succeed

Additional info:

Comment 2 Casey Carson 2016-07-27 15:15:42 UTC
The OpenStack folks might be interested in this as I ran into this bug when testing out the neutron ml2 dns extension driver.  

When using the dns extension driver, neutron uses the <instancename>.suffix in the dnsmasq host file as opposed to 'host-<IP>.suffix'

If the instance begins with a number, the aforementioned problem occurs and the instance is unable to get its dhcp lease from dnsmasq

Comment 5 Pavel Šimerda (pavlix) 2016-08-26 14:32:49 UTC
A simple test to check whether your version is affected:

dnsmasq-2.66/src/dnsmasq --test --dhcp-host=02:22:22:22:22:22,192.0.2.2,0myhostname

Note: It doesn't test the actual functionality, that would need a configured interface and other options and `--test` would be removed.

Comment 16 errata-xmlrpc 2016-11-04 06:14:56 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.

https://rhn.redhat.com/errata/RHBA-2016-2421.html