From owner-freebsd-net@FreeBSD.ORG Sun Mar 30 10:22:44 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BB43106564A for ; Sun, 30 Mar 2008 10:22:44 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by mx1.freebsd.org (Postfix) with ESMTP id C6B7F8FC15 for ; Sun, 30 Mar 2008 10:22:43 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 49582E3E2C; Sun, 30 Mar 2008 06:22:43 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Sun, 30 Mar 2008 06:22:43 -0400 X-Sasl-enc: kd8Q+WAyl+CUPO5ysHWk+0QFFO08Si4G28ukJkQCq7gy 1206872562 Received: from empiric.lon.incunabulum.net (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 8793024B51; Sun, 30 Mar 2008 06:22:42 -0400 (EDT) Message-ID: <47EF69F0.1050304@FreeBSD.org> Date: Sun, 30 Mar 2008 11:22:40 +0100 From: "Bruce M. Simpson" User-Agent: Thunderbird 2.0.0.9 (X11/20080207) MIME-Version: 1.0 To: Eugene Grosbein References: <47EE42C8.3070100@quip.cz> <20080329204344.GA66910@lor.one-eyed-alien.net> <20080330072137.GA35435@svzserv.kemerovo.su> In-Reply-To: <20080330072137.GA35435@svzserv.kemerovo.su> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: FreeBSD-Net mailing list , Brooks Davis , Miroslav Lachman <000.fbsd@quip.cz> Subject: Re: 7.0 - ifconfig create is not working as expected? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2008 10:22:44 -0000 Eugene Grosbein wrote: > On Sat, Mar 29, 2008 at 03:43:44PM -0500, Brooks Davis wrote: > > >>> I was using following command in FreeBSD 6.2: >>> # ifconfig lo1 create inet 172.16.16.2 netmask 255.255.255.0 >>> In FreeBSD 7.0 I got an error: >>> # ifconfig lo1 create inet 172.16.16.2 netmask 255.255.255.0 >>> ifconfig: inet: bad value >>> But it is working splitted in to two commands: >>> # ifconfig lo1 create >>> # ifconfig lo1 inet 172.16.16.2 netmask 255.255.255.0 >>> Is this expected behavior or should I file a PR? >>> >> This expected. There's some argument it's wrong, but filing a PR is >> unlikely to cause it to change any time soon. >> > > Why? The same with creating gif-tunnel, now I need to invoke ifconfig > twice, once for 'create' and once for other tunnel parameters, > whereas for RELENG_6 this works: 'ifconfig gif0 create tunnel 1.1.1.1 2.2.2.2' > > This breaks existing setups/scripts. This is POLA issue. > Why was it broken? > I don't know why or how this has happened, however, given the complexity of the command line grammar which ifconfig is expected to parse, our choices are limited, unless someone(tm) is willing to come along and implement a full parser in ifconfig. I investigated this some years ago and frankly didn't get anywhere, one of the constraints was that Sam wanted to modularize the ifconfig code, with a view to future dynamic loading -- as such, this places restrictions on the kind of parser which can be used. There is valid argument that we should not do this, as ifconfig is a tool which sits in the base system, and should be kept simple and therefore small. On the other hand, there's also the argument that as ifconfig's syntax has grown considerably over the years, that we should go ahead and add a parser anyway. In the absence of a full-blown parser, I'm comfortable with "ifconfig create" being a separate operation, which preferably throws an error if other commands are included with it, and understand why these limitations apply. cheers BMS