Bug 803540 - DHCP server fails to start if the subnet is not the primary subnet for a device
DHCP server fails to start if the subnet is not the primary subnet for a device
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: dhcp (Show other bugs)
6.2
All Linux
low Severity medium
: rc
: ---
Assigned To: Jiri Popelka
Release Test Team
: Patch, Reopened
Depends On: 449946
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-14 19:53 EDT by joshua
Modified: 2013-02-21 03:23 EST (History)
5 users (show)

See Also:
Fixed In Version: dhcp-4.1.1-33.P1.el6
Doc Type: Bug Fix
Doc Text:
Cause Network interface of a server has 2 or more configured IP addresses and the DHCP server itself is configured to serve subnets to whose the second (or any next, not just the first) IP address belongs. Consequence DHCP server is able to discover only the first IP address of network interface and therefore is able to serve only subnets to which only the first address belongs. If the server is configured to serve only subnet to which the second or any next IP address of the network interface belong, it refuses to start with 'No subnet declaration for ...' message. Fix Network interface addresses discovery code was completely changed. Result DHCP server is now able to find all addresses of a network interface and therefore is able to serve subnets to which these adressess belong.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 03:23:43 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Use getifaddrs() for interface discovery code on Linux (10.28 KB, patch)
2012-03-29 06:09 EDT, Jiri Popelka
no flags Details | Diff

  None (edit)
Description joshua 2012-03-14 19:53:51 EDT
Description of problem:

Same bug as http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=590641

We have a server with one NIC, on two logical networks, and DHCP won't work with the secondary (alias) interface and subnet.  Is there a fix for this?  This worked in DHCP v3, but not in v4.


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

dhcp-4.1.1-25.P1.el6_2.1.x86_64
Comment 1 joshua 2012-03-14 19:59:38 EDT
Here is the exact error:

No subnet declaration for br0:1 (no IPv4 addresses).
** Ignoring requests on br0:1.  If this is not what you want, please write a subnet declaration in your dhcpd.conf file for the network segment to which interface br0:1 is attached. **

... except that I *do* have a subnet declared that is on (and only on) br0:1 !
Comment 3 Jiri Popelka 2012-03-15 07:55:11 EDT
Yes, this is a "common bug" in dhcp-4, see bug #449946 and
https://lists.isc.org/pipermail/dhcp-hackers/2011-June/001920.html

There is a patch, however it's quite invasive and I'd rather not diverge from upstream *so much* (I don't see it much likely that they ever merge it).

I'm sure this bug bothers you but I'd rather not use this patch in RHEL-6, because it could break a lot of other stuff.
What about this plan ? :
- I'll make a RHEL-6 scratch build (testing build that won't make it into official repositories) for you with this patch applied.
  I just need to know which architecture (x86_64/i686 etc.) do you use so I can send proper testing packages to you.
- If you confirm that it fixes the problem for you and you see no regressions I'll finally fix bug #449946 in Fedora so the patch gets some more testing in Fedora and will eventually make it into RHEL-7.

I'm closing (however we can still discuss it here) this ticket as NEXTRELEASE because it could eventually be fixed in RHEL-7.
But it won't be fixed in RHEL-6 from reasons stated earlier. Thank you for understanding.
Comment 4 joshua 2012-03-15 15:17:43 EDT
Awesome!  RHEL 6.2 x86_64 is what we are using.

I can test said scratch packages for you immediately
Comment 5 Jiri Popelka 2012-03-21 09:11:38 EDT
Try this:
http://jpopelka.fedorapeople.org/dhcp-netlink/
Comment 6 Jiri Popelka 2012-03-29 06:09:10 EDT
Created attachment 573612 [details]
Use getifaddrs() for interface discovery code on Linux

(In reply to comment #3)
> Yes, this is a "common bug" in dhcp-4, see bug #449946 and
> https://lists.isc.org/pipermail/dhcp-hackers/2011-June/001920.html
> 
> There is a patch, however it's quite invasive and I'd rather not diverge from
> upstream *so much* (I don't see it much likely that they ever merge it).

As I stated in bug #449946, comment #9 I had figured out another solution than the patch from dhcp-hackers mailing list. It's simple - it actually throws out all the interface discovery code (380 lines) for Linux and uses the same code as for *BSD/OSX, i.e. getifaddrs() function.
Therefore it shouldn't break anything and also could be acceptable for upstream.

> But it won't be fixed in RHEL-6 from reasons stated earlier.

I changed my mind. Reopenning for RHEL-6.
Comment 10 Jiri Popelka 2012-08-24 10:14:23 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause
Network interface of a server has 2 or more configured IP addresses and the DHCP server itself is configured to serve subnets to whose the second (or any next, not just the first) IP address belongs.

Consequence
DHCP server is able to discover only the first IP address of network interface and therefore is able to serve only subnets to which only the first address belongs. If the server is configured to serve only subnet to which the second or any next IP address of the network interface belong, it refuses to start with 'No subnet declaration for ...' message.

Fix
Network interface addresses discovery code was completely changed.

Result
DHCP server is now able to find all addresses of a network interface and therefore is able to serve subnets to which these adressess belong.
Comment 12 Ladislav Jozsa 2012-09-25 10:50:17 EDT
Verified on RHEL6, dhcp-4.1.1-34.P1.el6.x86_64. dhcpd is now able to start and provide service when configured to bind to secondary IP address only.
Comment 13 errata-xmlrpc 2013-02-21 03:23:43 EST
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/RHSA-2013-0504.html

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