Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Dec 2019 03:56:37 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r355482 - stable/12/sbin/dhclient
Message-ID:  <201912070356.xB73ubvP043786@repo.freebsd.org>

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



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