svn commit: r355482 - stable/12/sbin/dhclient

Ed Maste emaste at FreeBSD.org
Sat Dec 7 03:56:37 UTC 2019


Author: emaste
Date: Sat Dec  7 03:56:36 2019
New Revision: 355482
URL: https://svnweb.freebsd.org/changeset/base/355482

Log:
  MFC r238022 (cem): dhclient: 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>

Modified:
  stable/12/sbin/dhclient/dhclient.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/dhclient/dhclient.c
==============================================================================
--- stable/12/sbin/dhclient/dhclient.c	Sat Dec  7 03:34:03 2019	(r355481)
+++ stable/12/sbin/dhclient/dhclient.c	Sat Dec  7 03:56:36 2019	(r355482)
@@ -1774,7 +1774,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