From owner-svn-src-head@freebsd.org Tue Mar 21 12:35:56 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 441CCD1604C; Tue, 21 Mar 2017 12:35:56 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 06C6915B5; Tue, 21 Mar 2017 12:35:56 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1cqJ0t-000IX4-IT; Tue, 21 Mar 2017 15:35:47 +0300 Date: Tue, 21 Mar 2017 15:35:47 +0300 From: Slawa Olhovchenkov To: Toomas Soome Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r315653 - in head: lib/libstand sys/boot/common sys/boot/i386/libi386 Message-ID: <20170321123547.GC86500@zxy.spb.ru> References: <201703202220.v2KMKHVP050735@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201703202220.v2KMKHVP050735@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false 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: Tue, 21 Mar 2017 12:35:56 -0000 On Mon, Mar 20, 2017 at 10:20:17PM +0000, Toomas Soome wrote: > Author: tsoome > Date: Mon Mar 20 22:20:17 2017 > New Revision: 315653 > URL: https://svnweb.freebsd.org/changeset/base/315653 > > Log: > loader: verify the value from dhcp.interface-mtu and use snprintf to set mtu > > Since the uset can set dhcp.interface-mtu, we need to try to validate the > value. So we verify if the conversion to int is successful and we will not > allow to set value greater than max IPv4 packet size. > > + tmp > USHRT_MAX) { > + printf("%s: bad value: \"%s\", " > + "ignoring\n", > + "dhcp.interface-mtu", val); === USHRT_MAX Maximum value for an object of type unsigned short int 65535 (216-1) or greater* * the actual value depends on the particular system and library implementation, but shall reflect the limits of these types in the target platform. === I mean IF_MAXMTU more correct.