From owner-svn-src-head@freebsd.org Sat May 27 10:50:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5DBBD83ED4; Sat, 27 May 2017 10:50:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E2331196; Sat, 27 May 2017 10:50:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4RAoZXY051186; Sat, 27 May 2017 10:50:35 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4RAoZDC051184; Sat, 27 May 2017 10:50:35 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201705271050.v4RAoZDC051184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 27 May 2017 10:50:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318982 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 May 2017 10:50:37 -0000 Author: bapt Date: Sat May 27 10:50:35 2017 New Revision: 318982 URL: https://svnweb.freebsd.org/changeset/base/318982 Log: Pass a "FREEBSD" user-class in PXE dhcp request rfc3004 allows to pass multiple user classes on dhcp requests this is used by dhcp servers to differentiate the caller if needed. As an example with isc dhcp server it will be possible to make options only for the FreeBSD loaders: if exists user-class and option user-class = "FREEBSD" { option root-path "tftp://192.168.42.1/FreeBSD; } Reviewed by: tsoome Differential Revision: https://reviews.freebsd.org/D10951 Modified: head/lib/libstand/bootp.c head/lib/libstand/bootp.h Modified: head/lib/libstand/bootp.c ============================================================================== --- head/lib/libstand/bootp.c Sat May 27 08:30:32 2017 (r318981) +++ head/lib/libstand/bootp.c Sat May 27 10:50:35 2017 (r318982) @@ -146,16 +146,20 @@ bootp(int sock, int flag) bp->bp_vend[7] = TAG_CLASSID; bp->bp_vend[8] = 9; bcopy("PXEClient", &bp->bp_vend[9], 9); - bp->bp_vend[18] = TAG_PARAM_REQ; - bp->bp_vend[19] = 7; - bp->bp_vend[20] = TAG_ROOTPATH; - bp->bp_vend[21] = TAG_HOSTNAME; - bp->bp_vend[22] = TAG_SWAPSERVER; - bp->bp_vend[23] = TAG_GATEWAY; - bp->bp_vend[24] = TAG_SUBNET_MASK; - bp->bp_vend[25] = TAG_INTF_MTU; - bp->bp_vend[26] = TAG_SERVERID; - bp->bp_vend[27] = TAG_END; + bp->bp_vend[18] = TAG_USER_CLASS; + bp->bp_vend[19] = 8; + bp->bp_vend[20] = 7; + bcopy("FREEBSD", &bp->bp_vend[21], 7); + bp->bp_vend[28] = TAG_PARAM_REQ; + bp->bp_vend[29] = 7; + bp->bp_vend[30] = TAG_ROOTPATH; + bp->bp_vend[31] = TAG_HOSTNAME; + bp->bp_vend[32] = TAG_SWAPSERVER; + bp->bp_vend[33] = TAG_GATEWAY; + bp->bp_vend[34] = TAG_SUBNET_MASK; + bp->bp_vend[35] = TAG_INTF_MTU; + bp->bp_vend[36] = TAG_SERVERID; + bp->bp_vend[37] = TAG_END; } else bp->bp_vend[7] = TAG_END; #else Modified: head/lib/libstand/bootp.h ============================================================================== --- head/lib/libstand/bootp.h Sat May 27 08:30:32 2017 (r318981) +++ head/lib/libstand/bootp.h Sat May 27 10:50:35 2017 (r318982) @@ -108,6 +108,7 @@ struct bootp { #define TAG_T2 ((unsigned char) 59) #define TAG_CLASSID ((unsigned char) 60) #define TAG_CLIENTID ((unsigned char) 61) +#define TAG_USER_CLASS ((unsigned char) 77) #endif #define TAG_END ((unsigned char) 255)