From: Tim Deegan Subject: Re: [PATCH] hotplug: fix ip_of for systems using peer-to-peer link Date: Tue, 10 Jul 2012 08:58:11 +0100 Message-ID: <20120710075811.GA46254@ocelot.phlegethon.org> References: <1341875693.8586.9.camel@hastur.hellion.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1341875693.8586.9.camel@hastur.hellion.org.uk> 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 Cc: "Marc A. Donges" , Stefan Tomanek , 437127@bugs.debian.org, xen-devel List-Id: xen-devel@lists.xenproject.org At 17:14 -0600 on 09 Jul (1341854093), Ian Campbell wrote: > diff -r 54384951de02 -r 1d33f934dd67 tools/hotplug/Linux/vif-common.sh > --- a/tools/hotplug/Linux/vif-common.sh Tue Jul 10 00:07:20 2012 +0100 > +++ b/tools/hotplug/Linux/vif-common.sh Tue Jul 10 00:14:54 2012 +0100 > @@ -175,7 +175,7 @@ handle_iptable() > # > ip_of() > { > - ip addr show "$1" | awk "/^.*inet.*$1\$/{print \$2}" | sed -n '1 s,/.*,,p' > + ip -4 -o addr show primary dev eth0 | awk '$3 == "inet" {split($4,i,"/"); print i[1]; exit}' s/eth0/"$1"/? Tim.