From owner-freebsd-net Thu Jul 6 16:25:13 2000 Delivered-To: freebsd-net@freebsd.org Received: from pike.osd.bsdi.com (pike.osd.bsdi.com [204.216.28.222]) by hub.freebsd.org (Postfix) with ESMTP id 3D40F37B9C0 for ; Thu, 6 Jul 2000 16:25:09 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: from foo.osd.bsdi.com (root@foo.osd.bsdi.com [204.216.28.137]) by pike.osd.bsdi.com (8.9.3/8.9.3) with ESMTP id QAA26570 for ; Thu, 6 Jul 2000 16:24:57 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: from FreeBSD.org (jhb@localhost [127.0.0.1]) by foo.osd.bsdi.com (8.9.3/8.9.3) with ESMTP id QAA09526 for ; Thu, 6 Jul 2000 16:24:32 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Message-ID: <39651530.2E0E0F8@FreeBSD.org> Date: Thu, 06 Jul 2000 16:24:32 -0700 From: John Baldwin Organization: BSD, Inc. X-Mailer: Mozilla 4.73 [en] (X11; I; FreeBSD 4.0-STABLE i386) X-Accept-Language: en MIME-Version: 1.0 To: net@FreeBSD.org Subject: Patches to ifconfig(8) to allow 'ether' to set ethernet addresses Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hey all, I've patched the ifconfig(8) utility to add in enough of the backend to the fake ether address "family" to allow setting addresses via the "ether" keyword. IOW, you can now do: ifconfig fxp0 ether Nothing else has been changed as far as the user interface. I did change the address family of the 'ether' address to AF_LINK, and just special cased the opening of the socket to fallback to AF_INET if the family it was trying to open was AF_INET. This also allowed several extra checks in addition to address family checking in the status output to be gotten rid of since the fake address "families" don't conflict with inet anymore. The patch can be found at http://people.FreeBSD.org/~jhb/patches/ether.patch. Also, as a side note, ifconfig -l
is broken. It only seems to work for the 'ether' family for some reason. Every other address family lists all the interfaces. The problem seems to be that the sysctl() call isn't actually limiting the list it returns by the address family. For example, I have no IPX interfaces configured on my current box, yet: > ifconfig -a | grep -i ipx > ifconfig -l ipx fxp0 lo0 gif0 gif1 gif2 gif3 stf0 faith0 -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.cslab.vt.edu/~jobaldwi/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message