From owner-freebsd-net@freebsd.org Wed Oct 21 14:59:54 2015 Return-Path: Delivered-To: freebsd-net@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 70F7CA1B414 for ; Wed, 21 Oct 2015 14:59:54 +0000 (UTC) (envelope-from elof2@sentor.se) Received: from smtp-out.sentor.se (smtp-out.sentor.se [176.124.225.2]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37DD3132C for ; Wed, 21 Oct 2015 14:59:53 +0000 (UTC) (envelope-from elof2@sentor.se) Received: from localhost (localhost [127.0.0.1]) by farmermaggot.shire.sentor.se (Postfix) with ESMTP id 9616CB61D235 for ; Wed, 21 Oct 2015 16:50:08 +0200 (CEST) Date: Wed, 21 Oct 2015 16:50:08 +0200 (CEST) From: elof2@sentor.se To: freebsd-net Subject: sysctl and signed net.bpf.maxbufsize variable Message-ID: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2015 14:59:54 -0000 Isn't this a bug? # sysctl net.bpf.maxbufsize=3000000000 net.bpf.maxbufsize: 524288 -> -1294967296 No error message and exit status is 0. Shouldn't net.bpf.maxbufsize be unsigned? I would like sysctl to have a crude sanity control and return an error if you set a positive value but the result becomes negative. ...and also have some specific sanity control to test if you try to set a value waaaay out of bounds (like setting net.bpf.maxbufsize to a value greater than the maximum RAM). /Elof