[Bug 1693819] Re: dhclient DHCPv6 does not work with interface alias
Dan Streetman
dan.streetman at canonical.com
Fri May 26 14:43:01 UTC 2017
This problem is because isc-dhcp strips the interface alias when it
enumerates the system interfaces, i.e. in common/discover.c function
next_iface():
/* interface aliases look like "eth0:1" or "wlan1:3" */
s = strchr(info->name, ':');
if (s != NULL) {
*s = '\0';
}
However when later searching the previously-enumerated list for the
matching interface for the cmdline interface parameter name, it does not
strip the interface alias from the cmdline interface name, i.e. in
common/discover.c function discover_interfaces():
/* Cycle through the list of interfaces looking for IP addresses. */
while (next_iface(&info, &err, &ifaces)) {
/* See if we've seen an interface that matches this one. */
for (tmp = interfaces; tmp; tmp = tmp->next) {
if (!strcmp(tmp->name, info.name))
break;
}
The 'info' interface will always have its info.name set to the actual interface name, without any alias extension, while the 'tmp' interface (from the cmdline) will have its tmp->name set to the interface including alias extension; the strcmp then never matches, so isc-dhcp is not able to correctly match the requested interface with the actual system interface.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to isc-dhcp in Ubuntu.
https://bugs.launchpad.net/bugs/1693819
Title:
dhclient DHCPv6 does not work with interface alias
Status in isc-dhcp package in Ubuntu:
New
Bug description:
[Impact]
The isc-dhcp-client dhclient program does not work with interface
alias names, e.g. eth0:1. It fails immediately.
[Test Case]
On trusty through artful, find an interface that is connected to a
network that has a DHCPv6 server on it. First verify it can get a
DHCPv6 address, e.g.:
$ sudo dhclient -6 -v ens7
that should successfully set up a DHCPv6 address on the interface.
Then release the interface:
$ sudo dhclient -6 -v -r ens7
Now, try again but use the interface alias, e.g.:
$ sudo dhclient -6 -v ens7:1
It should succeed, but it will fail with:
no link-local IPv6 address for ens7:1
[Regression Potential]
Changing how isc-dhcp handles (enumerates/lists/compares) interface
names may lead to isc-dhcp using the wrong interface or failing to
find the correct interface to use. However, if the only change is to
strip the alias part from the interface during comparison, the
possibility of error should be small, since all interface aliases
point back to the same physical interface.
[Other Info]
This bug exists in the upstream isc-dhcp; the ISC has no public bug
tracker, and only accepts bug reports via private email, which has
been sent.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/isc-dhcp/+bug/1693819/+subscriptions
More information about the foundations-bugs
mailing list