Date: Tue, 21 Mar 2017 15:35:47 +0300 From: Slawa Olhovchenkov <slw@zxy.spb.ru> To: Toomas Soome <tsoome@FreeBSD.org> 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> In-Reply-To: <201703202220.v2KMKHVP050735@repo.freebsd.org> References: <201703202220.v2KMKHVP050735@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170321123547.GC86500>