SO_BINDTODEVICE and ipv6
John Newlin
jnewlin at google.com
Sat May 31 16:55:05 UTC 2014
On Sat, May 31, 2014 at 9:29 AM, /dev/rob0 <rob0 at gmx.co.uk> wrote:
> On Thu, May 29, 2014 at 07:21:18AM -0700, John Newlin wrote:
> > In socket.c SO_BINDTODEVICE is not used for ipv6. Is there any
> > reason this isn't used for ipv6?
> >
> > Our system has two interfaces we want to run dhclient on, and
> > this is causing issues as the dhcpv6 Reply is going to the
> > wrong instance of dhclient. Before I change it, I'd like to
> > know the rationale for disabling it for ipv6.
>
> I admit to being mostly out of my league with this question, however
> in this case I think I have the right answer. :)
>
> DHCPv6, rather than using raw sockets as DHCPv4 did, communicates
> using the IPv6 link-local address.
>
> (I'd appreciate confirmation or correction from someone who knows
> better, thanks.)
>
Pretty sure that's correct. I have 1 physical interface, and am running on
the untagged and a vlan interface, and I think they have the same link
local address. I definitely see packets going to the wrong interface.
>
> As for the problem at hand, perhaps you could run a single dhclient
> instance for both interfaces?
>
Is that possible? I'll have to read the doc again. :)
>
> > // socket.c relevant code.
> > #if defined(SO_BINDTODEVICE)
> > /* Bind this socket to this interface. */
> > if ((local_family != AF_INET6) && (info->ifp != NULL) &&
> > setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE,
> > (char *)(info -> ifp), sizeof(*(info -> ifp))) <
> 0)
> > {
> > log_fatal("setsockopt: SO_BINDTODEVICE: %m");
> > }
> > #endif
> --
> http://rob0.nodns4.us/
> Offlist GMX mail is seen only if "/dev/rob0" is in the Subject:
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20140531/541f677f/attachment.html>
More information about the dhcp-users
mailing list