[pkg-dhcp-devel] Bug#863426: isc-dhcp: dhclient DHCPv6 does not work with interface alias

Dan Streetman dan.streetman at canonical.com
Wed Jun 7 22:08:24 UTC 2017


Package: isc-dhcp
Version: 4.3.5-3
Followup-For: Bug #863426
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu artful ubuntu-patch

Dear Maintainer,

an updated isc-dhcp patch is attached, that moves the interface alias
stripping to client/dhclient.c as soon as the parameter is parsed from argv.
This allows dhclient to handle the interface name with no alias at all times.
The previous patch failed to allow dhclient to release the interface.

Thanks for considering the patch.
-------------- next part --------------
diff -Nru isc-dhcp-4.3.5/debian/control isc-dhcp-4.3.5/debian/control
--- isc-dhcp-4.3.5/debian/control	2017-01-19 12:11:21.000000000 -0500
+++ isc-dhcp-4.3.5/debian/control	2017-06-07 16:38:45.000000000 -0400
@@ -1,8 +1,7 @@
 Source: isc-dhcp
 Section: net
 Priority: important
-Maintainer: Ubuntu Developers <ubuntu-devel-discuss at lists.ubuntu.com>
-XSBC-Original-Maintainer: Debian ISC DHCP maintainers <pkg-dhcp-devel at lists.alioth.debian.org>
+Maintainer: Debian ISC DHCP maintainers <pkg-dhcp-devel at lists.alioth.debian.org>
 Uploaders: Andrew Pollock <apollock at debian.org>, Michael Gilbert <mgilbert at debian.org>
 Vcs-Git: https://anonscm.debian.org/pkg-dhcp/isc-dhcp.git
 Vcs-Browser: https://anonscm.debian.org/gitweb/?p=pkg-dhcp/isc-dhcp.git;a=summary
diff -Nru isc-dhcp-4.3.5/debian/patches/series isc-dhcp-4.3.5/debian/patches/series
--- isc-dhcp-4.3.5/debian/patches/series	2017-01-19 12:11:21.000000000 -0500
+++ isc-dhcp-4.3.5/debian/patches/series	2017-06-07 16:38:38.000000000 -0400
@@ -32,3 +32,4 @@
 dhcp-improved-xid-correct-byte-order.patch
 dhcp-4.2.4-dhclient-options-changed.patch
 ubuntu-dhcpd-conf.patch
+strip-interface-alias.patch
diff -Nru isc-dhcp-4.3.5/debian/patches/strip-interface-alias.patch isc-dhcp-4.3.5/debian/patches/strip-interface-alias.patch
--- isc-dhcp-4.3.5/debian/patches/strip-interface-alias.patch	1969-12-31 19:00:00.000000000 -0500
+++ isc-dhcp-4.3.5/debian/patches/strip-interface-alias.patch	2017-06-07 16:38:38.000000000 -0400
@@ -0,0 +1,39 @@
+Author: Dan Streetman <dan.streetman at canonical.com>
+Description: Since isc-dhcp strips the interface alias from all
+  interfaces it enumerates, when comparing the cmdline interface
+  name to find the matching enumerated interface, the cmdline name
+  must have its alias stripped also.  Without this, DHCPv6 fails
+  when using an interface alias.
+Forwarded: yes
+Bug: [ISC bug tracking is private; bug email has been sent]
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/isc-dhcp/+bug/1693819
+
+
+Index: isc-dhcp-4.3.5/client/dhclient.c
+===================================================================
+--- isc-dhcp-4.3.5.orig/client/dhclient.c
++++ isc-dhcp-4.3.5/client/dhclient.c
+@@ -447,15 +447,19 @@ main(int argc, char **argv) {
+ 			      " requested interface %s", argv[i]);
+ 		} else {
+ 		    struct interface_info *tmp = NULL;
++		    int len;
+ 
+ 		    status = interface_allocate(&tmp, MDL);
+ 		    if (status != ISC_R_SUCCESS)
+ 			log_fatal("Can't record interface %s:%s",
+ 				  argv[i], isc_result_totext(status));
+-		    if (strlen(argv[i]) >= sizeof(tmp->name))
+-			    log_fatal("%s: interface name too long (is %ld)",
+-				      argv[i], (long)strlen(argv[i]));
+-		    strcpy(tmp->name, argv[i]);
++		    /* strip any interface alias, e.g. eth1:1 -> eth1 */
++		    len = strchrnul(argv[i], ':') - argv[i];
++		    if (len >= sizeof(tmp->name))
++			    log_fatal("%s: interface name too long (is %d)",
++				      argv[i], len);
++		    strncpy(tmp->name, argv[i], len);
++		    tmp->name[len] = 0;
+ 		    if (interfaces) {
+ 			    interface_reference(&tmp->next,
+ 						interfaces, MDL);


More information about the pkg-dhcp-devel mailing list