From owner-svn-src-head@FreeBSD.ORG Wed Jan 5 15:35:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55DF6106564A; Wed, 5 Jan 2011 15:35:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id F2F3E8FC1D; Wed, 5 Jan 2011 15:35:06 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 5850F41C7A7; Wed, 5 Jan 2011 16:35:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id sX3GD27XdI2H; Wed, 5 Jan 2011 16:35:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id A603B41C7A6; Wed, 5 Jan 2011 16:35:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 608B34448F3; Wed, 5 Jan 2011 15:34:30 +0000 (UTC) Date: Wed, 5 Jan 2011 15:34:30 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Marius Strobl In-Reply-To: <201101051528.p05FSVPL082696@svn.freebsd.org> Message-ID: <20110105153107.X14966@maildrop.int.zabbadoz.net> References: <201101051528.p05FSVPL082696@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217013 - in head: sbin/ifconfig sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 15:35:07 -0000 On Wed, 5 Jan 2011, Marius Strobl wrote: > Author: marius > Date: Wed Jan 5 15:28:30 2011 > New Revision: 217013 > URL: http://svn.freebsd.org/changeset/base/217013 > > Log: > Teach ifconfig(8) the handy shared option shortcut aliases the NetBSD > counterpart also takes, i.e. "fdx" for "full-duplex", "flow" for > "flowcontrol", "hdx" for "half-duplex" as well as "loop" and "loopback" > for "hw-loopback". I am not sure this is a good idea. Unless this is really really useful for compatibility with scripts (which I doubt) it'll sooner or later cause headaches, especially given some of the (new) names could be very well used for different things as well. > MFC after: 1 week > > Modified: > head/sbin/ifconfig/ifmedia.c > head/sys/net/if_media.h > > Modified: head/sbin/ifconfig/ifmedia.c > ============================================================================== > --- head/sbin/ifconfig/ifmedia.c Wed Jan 5 15:10:58 2011 (r217012) > +++ head/sbin/ifconfig/ifmedia.c Wed Jan 5 15:28:30 2011 (r217013) > @@ -421,6 +421,9 @@ static struct ifmedia_description ifm_su > static struct ifmedia_description ifm_shared_option_descriptions[] = > IFM_SHARED_OPTION_DESCRIPTIONS; > > +static struct ifmedia_description ifm_shared_option_aliases[] = > + IFM_SHARED_OPTION_ALIASES; > + > struct ifmedia_type_to_subtype { > struct { > struct ifmedia_description *desc; > @@ -429,7 +432,7 @@ struct ifmedia_type_to_subtype { > struct { > struct ifmedia_description *desc; > int alias; > - } options[3]; > + } options[4]; > struct { > struct ifmedia_description *desc; > int alias; > @@ -448,6 +451,7 @@ static struct ifmedia_type_to_subtype if > }, > { > { &ifm_shared_option_descriptions[0], 0 }, > + { &ifm_shared_option_aliases[0], 1 }, > { &ifm_subtype_ethernet_option_descriptions[0], 0 }, > { NULL, 0 }, > }, > @@ -465,6 +469,7 @@ static struct ifmedia_type_to_subtype if > }, > { > { &ifm_shared_option_descriptions[0], 0 }, > + { &ifm_shared_option_aliases[0], 1 }, > { &ifm_subtype_tokenring_option_descriptions[0], 0 }, > { NULL, 0 }, > }, > @@ -482,6 +487,7 @@ static struct ifmedia_type_to_subtype if > }, > { > { &ifm_shared_option_descriptions[0], 0 }, > + { &ifm_shared_option_aliases[0], 1 }, > { &ifm_subtype_fddi_option_descriptions[0], 0 }, > { NULL, 0 }, > }, > @@ -499,6 +505,7 @@ static struct ifmedia_type_to_subtype if > }, > { > { &ifm_shared_option_descriptions[0], 0 }, > + { &ifm_shared_option_aliases[0], 1 }, > { &ifm_subtype_ieee80211_option_descriptions[0], 0 }, > { NULL, 0 }, > }, > @@ -518,6 +525,7 @@ static struct ifmedia_type_to_subtype if > }, > { > { &ifm_shared_option_descriptions[0], 0 }, > + { &ifm_shared_option_aliases[0], 1 }, > { &ifm_subtype_atm_option_descriptions[0], 0 }, > { NULL, 0 }, > }, > > Modified: head/sys/net/if_media.h > ============================================================================== > --- head/sys/net/if_media.h Wed Jan 5 15:10:58 2011 (r217012) > +++ head/sys/net/if_media.h Wed Jan 5 15:28:30 2011 (r217013) > @@ -598,6 +598,15 @@ struct ifmedia_description { > { 0, NULL }, \ > } > > +#define IFM_SHARED_OPTION_ALIASES { \ > + { IFM_FDX, "fdx" }, \ > + { IFM_HDX, "hdx" }, \ > + { IFM_FLOW, "flow" }, \ > + { IFM_LOOP, "loop" }, \ > + { IFM_LOOP, "loopback" }, \ > + { 0, NULL }, \ > +} > + > /* > * Baudrate descriptions for the various media types. > */ > -- Bjoern A. Zeeb You have to have visions! Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html