svn commit: r355204 - head/sbin/dhclient

Conrad Meyer cem at FreeBSD.org
Fri Nov 29 03:31:48 UTC 2019


Author: cem
Date: Fri Nov 29 03:31:47 2019
New Revision: 355204
URL: https://svnweb.freebsd.org/changeset/base/355204

Log:
  Fix braino in previous bugfix r300174
  
  The previous revision missed the exact same error in a copy paste block
  of the same code in another function.  Fix the identical case, too.
  
  A DHCP client identifier is simply the hardware type (one byte)
  concatenated with the hardware address (some variable number of bytes,
  but at most 16).  Limit the size of the temporary buffer to match and
  the rest of the calculations shake out correctly.
  
  PR:		238022
  Reported by:	Young <yangx92 AT hotmail.com>
  Submitted by:	Young <yangx92 AT hotmail.com>
  MFC after:	I don't plan to but you should feel free
  Security:	yes

Modified:
  head/sbin/dhclient/dhclient.c

Modified: head/sbin/dhclient/dhclient.c
==============================================================================
--- head/sbin/dhclient/dhclient.c	Fri Nov 29 03:14:10 2019	(r355203)
+++ head/sbin/dhclient/dhclient.c	Fri Nov 29 03:31:47 2019	(r355204)
@@ -1782,7 +1782,7 @@ make_request(struct interface_info *ip, struct client_
 	}
 
 	/* set unique client identifier */
-	char client_ident[sizeof(struct hardware)];
+	char client_ident[sizeof(ip->hw_address.haddr) + 1];
 	if (!options[DHO_DHCP_CLIENT_IDENTIFIER]) {
 		int hwlen = (ip->hw_address.hlen < sizeof(client_ident)-1) ?
 				ip->hw_address.hlen : sizeof(client_ident)-1;


More information about the svn-src-all mailing list