From owner-freebsd-rc@FreeBSD.ORG Tue Feb 7 08:09:09 2012 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9832C106566B for ; Tue, 7 Feb 2012 08:09:09 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id 93B1A8FC15 for ; Tue, 7 Feb 2012 08:09:08 +0000 (UTC) Received: from alph.allbsd.org (p1012-ipbf2105funabasi.chiba.ocn.ne.jp [114.148.160.12]) (authenticated bits=128) by mail.allbsd.org (8.14.4/8.14.4) with ESMTP id q1788e6r089302; Tue, 7 Feb 2012 17:08:50 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.14.4/8.14.4) with ESMTP id q1788bGP013888; Tue, 7 Feb 2012 17:08:40 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Tue, 07 Feb 2012 17:02:55 +0900 (JST) Message-Id: <20120207.170255.161251905285915806.hrs@allbsd.org> To: erdgeist@erdgeist.org From: Hiroki Sato In-Reply-To: <4F3088C8.9090505@erdgeist.org> References: <4F304F54.4020802@FreeBSD.org> <20120207.072925.1861639312875773760.hrs@allbsd.org> <4F3088C8.9090505@erdgeist.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.4 on Emacs 23.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Tue_Feb__7_17_02_55_2012_310)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.3 (mail.allbsd.org [133.31.130.32]); Tue, 07 Feb 2012 17:08:56 +0900 (JST) X-Spam-Status: No, score=-100.8 required=13.0 tests=BAYES_00, CONTENT_TYPE_PRESENT,RCVD_IN_PBL,RCVD_IN_RP_RNBL,SPF_SOFTFAIL, USER_IN_WHITELIST autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on gatekeeper.allbsd.org Cc: freebsd-rc@FreeBSD.org Subject: Re: Proposal ipv6_addrs_common X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 08:09:09 -0000 ----Security_Multipart(Tue_Feb__7_17_02_55_2012_310)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Dirk Engling wrote in <4F3088C8.9090505@erdgeist.org>: er> - From my understanding all that's to do is to match the ifconfig er> parameter syntax and expand ip addresses. There's several ways to do that. er> er> You can just accept them as positional paramters in a function, and er> then shift them out one by one, matching inet and inet6, switching er> state and returning an expanded string to be executed by the caller. er> er> You can also match er> er> [ ${foo#inet} = ${foo} ] || foo=`expand_ipv4 ${foo}` er> er> or er> er> case ${foo} in "inet *") ... ; case "inet6 *") ;; Ah, I see. This looks good. I will give it a try and investigate corner cases. er> to do the actual work. What exactly is the newline for in that case? er> To make it clearer where single invocations of ifconfig need to be er> separated? er> er> There is no need to introduce any split characters, as inet and inet6 er> by themself act as such. In fact, they're not even needed as from the er> parameter itself the address family should become clear. I never er> understood why the code insist so heavily on the user to specify the er> inet and inet6 keywords. Any particular reason? This is because it is unclear that which address family will be used to recognize an address without AF keyword. In most cases network-related utilities/scripts assume IPv4 by default and require a modifier or option for the others. It works, but sometimes it requires a complex and inconsistent address handling in utilities/scripts. Appending AF keyword burdens users a bit but simplifies multiple address family support in more consistent manner. -- Hiroki ----Security_Multipart(Tue_Feb__7_17_02_55_2012_310)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk8w2q8ACgkQTyzT2CeTzy0jawCgjOqNhzK2ew7kjUbm42KCdJGA MdUAoJM8WLQ5/Pk/Ysu1LScDMOX2ynGJ =L1Gh -----END PGP SIGNATURE----- ----Security_Multipart(Tue_Feb__7_17_02_55_2012_310)----