From: Ian Campbell Subject: Re: [PATCH 5/5] hotplug/linux: Add IPv6 support to vif-route Date: Thu, 15 May 2014 17:20:48 +0100 Message-ID: <1400170848.883.16.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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WkyOq-0000ew-TF for xen-devel@lists.xenproject.org; Thu, 15 May 2014 16:20:53 +0000 In-Reply-To: <1400081005-23895-6-git-send-email-s.munaut@whatever-company.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: Sylvain Munaut Cc: xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org 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. Ian