From: Ian Campbell Subject: Re: [PATCH 5/5] hotplug/linux: Add IPv6 support to vif-route Date: Tue, 20 May 2014 12:27:22 +0100 Message-ID: <1400585242.6946.4.camel@kazak.uk.xensource.com> References: <1400081005-23895-1-git-send-email-s.munaut@whatever-company.com> <1400081005-23895-6-git-send-email-s.munaut@whatever-company.com> <1400170848.883.16.camel@kazak.uk.xensource.com> <1400577626.25175.21.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WmiCe-0003Zz-GH for xen-devel@lists.xenproject.org; Tue, 20 May 2014 11:27:28 +0000 In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Sylvain Munaut Cc: xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On Tue, 2014-05-20 at 13:17 +0200, Sylvain Munaut wrote: > Hi, > > > In theory I think this could be combined into a single helper which took > > $2 == '4' or '6' and "ip -$2 | ... inet${2%4}.." (then ip_of and ip6_of > > become invocations of that) > > It could. However this would also add a filter on 'scope global' for > ipv4 which isn't present at the moment. Not sure if this would affect > anything in practice ... True, I missed that aspect. > However since dom0_ip and dom0_ip6 need to stay separate (ipv4 is > mandatory and 'fatal' out if not found, but ipv6 is optional), I'm not > sure how useful it is to really combine there. Indeed, I'm happy not to do so if it doesn't seem worthwhile to you. > > But perhaps the ${2%4} bit is overly cryptic? > > Yeah, I had to re-read the doc :) I just tried the various options I know (%, %%, #, ##) till I found the one which did what I expect :-) Ian.