From owner-svn-src-projects@FreeBSD.ORG Fri Jan 23 02:20:40 2015 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44039FA5; Fri, 23 Jan 2015 02:20:40 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C126A931; Fri, 23 Jan 2015 02:20:38 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t0N2KYJX089230 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 23 Jan 2015 05:20:34 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t0N2KYTo089229; Fri, 23 Jan 2015 05:20:34 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 23 Jan 2015 05:20:34 +0300 From: Gleb Smirnoff To: Garrett Cooper Subject: Re: svn commit: r277543 - projects/ifnet/sys/net Message-ID: <20150123022034.GR15484@FreeBSD.org> References: <201501230002.t0N02R5W099367@svn.freebsd.org> <21EFD3A7-91CA-4FF9-BD84-C6AD847A11ED@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <21EFD3A7-91CA-4FF9-BD84-C6AD847A11ED@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 02:20:40 -0000 Garrett, of course the smallest commit to the branch gets most attention :) On Thu, Jan 22, 2015 at 04:18:08PM -0800, Garrett Cooper wrote: G> > Modified: projects/ifnet/sys/net/if_ethersubr.c G> > ============================================================================== G> > --- projects/ifnet/sys/net/if_ethersubr.c Thu Jan 22 23:59:35 2015 (r277542) G> > +++ projects/ifnet/sys/net/if_ethersubr.c Fri Jan 23 00:02:26 2015 (r277543) G> > @@ -985,7 +985,7 @@ ether_ioctl(struct ifnet *ifp, u_long co G> > } G> > break; G> > default: G> > - error = EINVAL; /* XXX netbsd has ENOTTY??? */ G> > + error = EOPNOTSUPP; G> > break; G> > } G> > return (error); G> G> Uh, didn’t you just break the ioctl(2) ERRORS guarantee? G> G> [EBADF] The fd argument is not a valid descriptor. G> G> [ENOTTY] The fd argument is not associated with a character G> special device. G> G> [ENOTTY] The specified request does not apply to the kind of G> object that the descriptor fd references. G> G> [EINVAL] The request or argp argument is not valid. G> G> [EFAULT] The argp argument points outside the process's G> allocated address space. We've got this stack: sys_ioctl() -> ifioctl() -> if_drvioctl() -> xxx_ioctl() | | ift_ioctl() Where, ift_ioctl() and xxx_ioctl() are optional, and also interface ops can be stacked. And EOPNOTSUPP is an indicator that says "I don't know the op, but please pass it to other layer, like interface type, or down the stack". To preserve the ioctl(2) interface, we can convert EOPNOTSUPP -> ENOTTY at sys_ioctl() later. -- Totus tuus, Glebius.