Report information
The Basics
Id:
34784
Status:
resolved
Worked:
15 minutes
Priority:
Medium/Medium
Queue:

BugTracker
Version Fixed:
4.1-ESV-R9, 4.2.6, 4.3.0
Version Found:
(no value)
Versions Affected:
(no value)
Versions Planned:
(no value)
Priority:
(no value)
Severity:
S1 High
CVSS Score:
(no value)
CVE ID:
(no value)
Component:
(no value)
Area:
(no value)

Dates
Created:Thu, 12 Sep 2013 11:56:23 -0400
Updated:Wed, 21 Mar 2018 14:22:13 -0400
Closed:Wed, 30 Oct 2013 17:04:59 -0400



This bug tracker is no longer active.

Please go to our Gitlab to submit issues (both feature requests and bug reports) for active projects maintained by Internet Systems Consortium (ISC).

Due to security and confidentiality requirements, full access is limited to the primary maintainers.

Subject: more 'dhclient -6' instances steal each other packets
Date: Thu, 12 Sep 2013 17:56:06 +0200
To: dhcp-bugs@isc.org
From: Jiri Popelka <jpopelka@redhat.com>
Hi all, When there are more 'dhclient -6' instances running (one instance per network interface), always only one of them gets all the packets (even those destined for the other instances). The exact behavior depends on linux kernel version, either only the first or only the last started instance gets all the packets, but the problem remains. I think the problem is that DHCPv6 part of if_register_socket() binds to address from local_address6 variable but this variable has never been initialized so it's always 0. The solution could be to bind to link local address of interface. We also need to have separate socket for each interface, not one single for all - this was changed in 4.1.0a2. I don't know the internals, so the patch can be completely wrong but up to now it's seemed to fix the problem and not cause any others. I'll update it if I find something better. See also http://serverfault.com/questions/471076/ipv6-two-interfaces-with-dhclient I'm looking forward to hear from you soon. -- Jiri Popelka Red Hat, inc.

Message body is not shown because sender requested not to inline it.

On Thu Sep 12 15:56:23 2013, jpopelka@redhat.com wrote: => a simple question: is the problem for multicast or unicast packets (it should work for multicast packets but for unicast packets it has no chance to work with a single global socket bound to *.port)? > When there are more 'dhclient -6' instances running > (one instance per network interface), > always only one of them gets all the packets > (even those destined for the other instances). > The exact behavior depends on linux kernel version, either only the > first or only the last started instance gets all the packets, > but the problem remains. => IMHO the correct behaviour should be to have bind() rejected but it implies SO_REUSEPORT to be implemented and SO_REUSEADDR fixed. I don't know if it will help here but at least it will align with the BSD (and IMHO correct) behaviour... > I think the problem is that DHCPv6 part of if_register_socket() binds to > address from local_address6 variable but this variable has never been > initialized so it's always 0. => local_address* is for agents (i.e., relays and servers). In fact this part of the code is essentially for agents. > I don't know the internals, so the patch can be completely wrong > but up to now it's seemed to fix the problem and not cause any others. > I'll update it if I find something better. => I am afraid it will break agents via the multicast receive. > See also > http://serverfault.com/questions/471076/ipv6-two-interfaces-with-dhclient => it will be tested too as the goal is to have something which supports any partition of clients over multiple interfaces.
CC: Pavel Simerda <psimerda@redhat.com>
Subject: Re: [ISC-Bugs #34784] more 'dhclient -6' instances steal each other packets
Date: Mon, 23 Sep 2013 10:28:39 +0200
To: dhcp-bugs@isc.org
From: Jiri Popelka <jpopelka@redhat.com>
First of all thank you for you reply ! On 09/22/2013 10:07 AM, Francis Dupont via RT wrote: > On Thu Sep 12 15:56:23 2013, jpopelka@redhat.com wrote: > > => a simple question: is the problem for multicast or > unicast packets (it should work for multicast packets > but for unicast packets it has no chance to work with > a single global socket bound to *.port)? Unicast I think - I've seen it with Reply in response to Renew/Rebind and on other machine (kernel) with Advertise. > => local_address* is for agents (i.e., relays and servers). > In fact this part of the code is essentially for agents. > >> I don't know the internals, so the patch can be completely wrong >> but up to now it's seemed to fix the problem and not cause any others. >> I'll update it if I find something better. > > => I am afraid it will break agents via the multicast receive. We already dropped it and have been using the following, i.e. binding to interface even for AF_INET6: +++ dhcp-4.2.5/common/socket.c @@ -245,7 +245,7 @@ if_register_socket(struct interface_info #if defined(SO_BINDTODEVICE) /* Bind this socket to this interface. */ - if ((local_family != AF_INET6) && (info->ifp != NULL) && + if (((do_multicast == 0)||(*do_multicast == 0)) && (info->ifp != NULL) && setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, (char *)(info -> ifp), sizeof(*(info -> ifp))) < 0) { log_fatal("setsockopt: SO_BINDTODEVICE: %m"); regards, Jiri
On Mon Sep 23 08:28:55 2013, jpopelka@redhat.com wrote: > > => a simple question: is the problem for multicast or > > unicast packets (it should work for multicast packets > > but for unicast packets it has no chance to work with > > a single global socket bound to *.port)? => as this is about clients it should be unicast only. BTW the code was written for a relay or a server or an unique client (and for Unixes including BSDs and Linux). > > => I am afraid it will break agents via the multicast receive. > > We already dropped it and have been using the following, i.e. binding to > interface even for AF_INET6: => SO_BINDTODEVICE is system specific so can't be a critical part of the solution. BTW I can say the same about SO_REUSEPORT as when it is implemented SO_REUSEADDR still detects multiple clients trying to bind() to *,port... But as we have to support BSDs and Linuxes I am afraid the only solution is to bind() to the (?) link-local address.
It is fixed now (by binding client sockets to link-local addresses). You could ask the reviewer for a test distrib if you'd like to check yourself... (just answer this message)
Thank you for the report and patch.  We have
chosen to continue using the current style of
sockets but have updated the code to use
link local addresses for clients.

This patch has been committed to:
master => 4.3.0 first
4.2 => 4.2.6 first
4.1-ESV => 4.1-ESV-R9 first

If you'd like I can send you a copy of the patch
for your testing.


Subject: Re: [ISC-Bugs #34784] more 'dhclient -6' instances steal each other packets
Date: Tue, 22 Oct 2013 11:46:59 +0200
To: dhcp-review@isc.org
From: Jiri Popelka <jpopelka@redhat.com>
On 10/22/2013 12:27 AM, Shawn Routhier via RT wrote: > If you'd like I can send you a copy of the patch > for your testing. That would be nice, thank you ! -- Jiri
I'm attempting to send you a file of the patch.
If you don't get one, or it's garbled please respond
and I'll send it a different way.  

thanks,

Shawn


Subject: rt34784.diff

Message body not shown because it is not plain text.

I should probably add, the diff is to the current head
of our development tree.  In this case I don't think
there are any differences between it and 4.2.x and
the differences between it and 4.1.x are hopefully easily
understandable.

regards,
Shawn