From owner-freebsd-net Mon Oct 8 0:32:24 2001 Delivered-To: freebsd-net@freebsd.org Received: from snark.rinet.ru (snark.rinet.ru [195.54.192.73]) by hub.freebsd.org (Postfix) with ESMTP id C72E337B405; Mon, 8 Oct 2001 00:32:17 -0700 (PDT) Received: (from yar@localhost) by snark.rinet.ru (8.11.6/8.11.6) id f987WE768678; Mon, 8 Oct 2001 11:32:14 +0400 (MSD) (envelope-from yar) Date: Mon, 8 Oct 2001 11:32:14 +0400 From: Yar Tikhiy To: net@freebsd.org, hackers@freebsd.org Subject: Some thoughts on if_ioctl() Message-ID: <20011008113214.A68390@snark.rinet.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.22.1i Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi there, I'd like to discuss the following issues prior to modifying the kernel. First, the current implementation of the utility function ether_ioctl(), which can do good job common to ethernet drivers, won't indicate the situation when an ioctl command is unsupported by it. It will return 0 in this case. Wouldn't it be better to return EINVAL so the driver can do something about that? Now each driver using ether_ioctl() has to maintain painfully the list of the ioctl commands that may be passed to ether_ioctl(), or the kernel will be likely to panic in copyout() dereferencing a NULL pointer. Second, let's look at the handling of SIOCADDMULTI/SIOCDELMULTI. There is code obviously taken from if_loop.c and used in some drivers, which tries to do something with the third argument "data" of the if_ioctl() driver method if "data" isn't NULL. If I understand the kernel code right, if_ioctl()'s third argument is always NULL and serves nothing since these ioctl commands just notify the driver that the list of multicast groups on an interface has been changed. Is it true? If it is, I'd like to remove the questionable code and document the feature in ifnet(9) for newbie kernel hackers will be confused no longer. -- Yar To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message