From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Andryuk Subject: Re: [PATCH 5/5] hotplug/linux: Add IPv6 support to vif-route Date: Fri, 16 May 2014 15:17:21 -0400 Message-ID: <53766441.50008@aero.org> 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WlNds-0006M6-PZ for xen-devel@lists.xenproject.org; Fri, 16 May 2014 19:18:05 +0000 In-Reply-To: <1400170848.883.16.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell , Sylvain Munaut Cc: xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On 5/15/2014 12:20 PM, Ian Campbell wrote: > On Wed, 2014-05-14 at 17:23 +0200, Sylvain Munaut wrote: >> Signed-off-by: Sylvain Munaut >> --- >> tools/hotplug/Linux/vif-common.sh | 33 +++++++++++++++++++++++++++++++++ >> tools/hotplug/Linux/vif-route | 20 +++++++++++++++++++- >> 2 files changed, 52 insertions(+), 1 deletion(-) >> >> diff --git a/tools/hotplug/Linux/vif-common.sh b/tools/hotplug/Linux/vif-common.sh >> index 2f24274..cd341a33 100644 >> --- a/tools/hotplug/Linux/vif-common.sh >> +++ b/tools/hotplug/Linux/vif-common.sh >> @@ -324,3 +324,36 @@ dom0_ip() >> fi >> echo "$result" >> } >> + >> + >> +## >> +# ip6_of interface >> +# >> +# Print the first IPv6 address currently in use at the given interface, or nothing if >> +# the interface is not up. >> +# >> +ip6_of() >> +{ >> + ip -6 addr show primary dev "$1" | perl -wane '/scope global/ && /inet6 (([0-9a-f]+:*)+)/ && print $1;' > > Hrm, Perl again. Can this be done with awk? Looks tricky though. Something like: awk '/inet6 .* scope global/ { split($2, v6, "/"); print v6[1] }' (Removing perl from locking.sh would be nice, since it's a large requirement for the one use.) Regards, Jason