From owner-freebsd-stable@FreeBSD.ORG Fri Dec 21 03:43:42 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 37104C6B; Fri, 21 Dec 2012 03:43:42 +0000 (UTC) (envelope-from kpaasial@gmail.com) Received: from mail-we0-f176.google.com (mail-we0-f176.google.com [74.125.82.176]) by mx1.freebsd.org (Postfix) with ESMTP id 8D29D8FC0C; Fri, 21 Dec 2012 03:43:41 +0000 (UTC) Received: by mail-we0-f176.google.com with SMTP id r5so1897081wey.7 for ; Thu, 20 Dec 2012 19:43:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=WL3n/sXOSIEqphq51n9vTF9wrgpVmkDD+BwwU/ixaWY=; b=zP5SxjDCjPN2h/fmAIXqYuCASfdm5LD5anLJxbl2XN9T1RE4vxx9Vn/CEglyjIp+sh lTw9Zf1KhkSWMgMGMcIzVNvak9lQN9regobcH5Yt1EKljfxMpypV24TCiLMTtZTF+I/l ViVhLF+AwU3OEUA7E3YZuQ768ypwQ+eEsdn0SqurtzipaXI4ES12a/gHtuXZwDRfDGHs qxJJtZ+oqUeMgFUsMDx6/uDOv1j1JmbtSq4Fuy+aUjDH9rReICkJ70nL3dz2XpcjxPx6 XL11U9Io+e4+AoxK0b1Nfkldv7dtqikegfE/O76QqVO9UGKWXLkvI8VpUa202YobEtrG +acw== MIME-Version: 1.0 Received: by 10.180.100.197 with SMTP id fa5mr13118031wib.32.1356061414815; Thu, 20 Dec 2012 19:43:34 -0800 (PST) Received: by 10.216.172.197 with HTTP; Thu, 20 Dec 2012 19:43:34 -0800 (PST) In-Reply-To: <20121220132750.GB99616@stack.nl> References: <50D1C553.9060100@wasikowski.net> <20121220132750.GB99616@stack.nl> Date: Fri, 21 Dec 2012 05:43:34 +0200 Message-ID: Subject: Re: ipv6_addrs_IF aliases in rc.conf(5) From: Kimmo Paasiala To: Jilles Tjoelker Content-Type: multipart/mixed; boundary=f46d04182644ec798b04d154a644 Cc: freebsd-current@freebsd.org, freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2012 03:43:42 -0000 --f46d04182644ec798b04d154a644 Content-Type: text/plain; charset=UTF-8 On Thu, Dec 20, 2012 at 3:27 PM, Jilles Tjoelker wrote: > On Thu, Dec 20, 2012 at 01:04:34PM +0200, Kimmo Paasiala wrote: >> A question related to this for those who have been doing work on the >> rc(8) scripts. Can I assume that /usr/bin is available when >> network.subr functions are used? Doing calculations on hexadecimal >> numbers is going to be very awkward if I can't use for example bc(1). > > You cannot assume that /usr/bin is available when setting up the > network. It may be that /usr is mounted via NFS. > > You can use hexadecimal numbers (prefixed with 0x) in $((...)) > expressions. In FreeBSD 9.0 or newer, sh has a printf builtin you can > use; in older versions you can use hexdigit and hexprint from > network.subr. > > -- > Jilles Tjoelker Thanks, I've rewitten my patch to support ranges. It is attached in this message. Again it's against a very recent 9-STABLE, I still haven't found time to see if it applies to CURRENT. It does allow you to do crazy stuff like ipv6_addrs_re0="2001:db8:1111:2222::1-ffff/64" However I didn't find anything to limit the number of aliases in the ipv4 version of the function either. Please test it :) Then a question about the PR (http://www.freebsd.org/cgi/query-pr.cgi?pr=174225) I wrote, how can I attach this new patch to it? The submit follow up -button fires up my email client and I'm not so sure how to submit a new patch for the PR in an email in such a way that it appears properly formatted in the PR. Regards, Kimmo Paasiala --f46d04182644ec798b04d154a644 Content-Type: text/plain; charset=US-ASCII; name="network.subr_ipv6_addrs_range.patch.txt" Content-Disposition: attachment; filename="network.subr_ipv6_addrs_range.patch.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hayrqiqv0 SW5k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HtfaXA2YWRkciU6Kn0KKwkJX2lwNmxvdz0ke19yYW5nZSUtKn0KKwkJX2lw NmhpZ2g9JHtfcmFuZ2UjKi19CisKKyMgSWYgZGVsZXRpbmcgYW4gYWxpYXMsIHNldCBfcHJlZml4 bGVuIHRvIG51bGwgc3RyaW5nLgorCQlpZiBbICIke19hY3Rpb259IiA9ICItYWxpYXMiIF07IHRo ZW4KKwkJCV9wcmVmaXhsZW49IiIKKwkJZWxzZQorCQkJX3ByZWZpeGxlbj0icHJlZml4bGVuICRf cHJlZml4bGVuIgorCQlmaQorCisJCV9pcDZoaWdoPSQoKCIweCR7X2lwNmhpZ2h9IikpCisJCV9p cDZjb3VudD0kKCgiMHgke19pcDZsb3d9IikpCisJCXdoaWxlIFsgIiR7X2lwNmNvdW50fSIgLWxl ICIke19pcDZoaWdofSIgIF07IGRvCisgICAgICAgICAgICAjIFJlLXVzZXMgdGhlIF9pcDZhZGRy IHZhcmlhYmxlIGZyb20gYWJvdmUKKwkJCV9pcDZhZGRyPSQocHJpbnRmICIleCIgIiR7X2lwNmNv dW50fSIpCisJCQlldmFsICJpZmNvbmZpZyAke19pZn0gaW5ldDYgJHtfaXA2bmV0fToke19pcDZh ZGRyfSAke19wcmVmaXhsZW59ICR7X2FjdGlvbn0iCisJCQlfaXA2Y291bnQ9JCgoJHtfaXA2Y291 bnR9KzEpKQorCQkJX3JldD0wCisJCWRvbmUKKwlkb25lCisKKwlyZXR1cm4gJF9yZXQKK30KKwor CisKICMgaWZhbGlhc191cCBpZiBhZgogIwlDb25maWd1cmUgYWxpYXNlcyBmb3IgbmV0d29yayBp bnRlcmZhY2UgJGlmLgogIwlJdCByZXR1cm5zIDAgaWYgYXQgbGVhc3Qgb25lIGFsaWFzIHdhcyBj b25maWd1cmVkIG9yCg== --f46d04182644ec798b04d154a644--