Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Nov 2019 03:31:47 +0000 (UTC)
From:      Conrad Meyer <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r355204 - head/sbin/dhclient
Message-ID:  <201911290331.xAT3VlHO016552@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201911290331.xAT3VlHO016552>