Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Xen: Devel

[PATCH] hotplug: fix ip_of for systems using peer-to-peer link

 

 

Xen devel RSS feed   Index | Next | Previous | View Threaded


ijc at hellion

Jul 9, 2012, 4:14 PM

Post #1 of 6 (69 views)
Permalink
[PATCH] hotplug: fix ip_of for systems using peer-to-peer link

# HG changeset patch
# User Ian Campbell <ian.campbell [at] citrix>
# Date 1341875694 -3600
# Node ID 1d33f934dd675a1b91d2d4e0fa2d2a873a8debf5
# Parent 54384951de02e2db909116d64aa6a65d06ffa708
hotplug: fix ip_of for systems using a peer-to-peer link

This is from an old Debian bug at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=437127

I'm slightly inferring what the configuration which trigger this issue is, the
bug report says:

This code however fails if no slash is present in the address, which is the
case in my configuration:

$ ip addr show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:16:17:90:b4:35 brd ff:ff:ff:ff:ff:ff
inet 88.198.12.XXX peer 88.198.12.XXX/32 brd 88.255.255.255 scope global eth0

I hope either Marc or Stefan can correct me if I have surmised wrongly what
this configuration represents.

This function is used in the vif-route configuration.

Signed-off-by: Ian Campbell <ian.campbell [at] citrix>

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}'
}





_______________________________________________
Xen-devel mailing list
Xen-devel [at] lists
http://lists.xen.org/xen-devel


tim at xen

Jul 10, 2012, 12:58 AM

Post #2 of 6 (63 views)
Permalink
Re: [PATCH] hotplug: fix ip_of for systems using peer-to-peer link [In reply to]

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.

_______________________________________________
Xen-devel mailing list
Xen-devel [at] lists
http://lists.xen.org/xen-devel


ijc at hellion

Jul 10, 2012, 7:05 AM

Post #3 of 6 (62 views)
Permalink
Re: [PATCH] hotplug: fix ip_of for systems using peer-to-peer link [In reply to]

On Tue, 2012-07-10 at 03:58 -0400, Tim Deegan wrote:
> 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"/?

Yes, looks like a cut-n-paste from the version I tried manually on the
command line not the bug. oops

8<---------------------------------

# HG changeset patch
# User Ian Campbell <ian.campbell [at] citrix>
# Date 1341929173 -3600
# Node ID ca5c306052791edf6d96da3f80aecd750b86a5e4
# Parent 54384951de02e2db909116d64aa6a65d06ffa708
hotplug: fix ip_of for systems using a peer-to-peer link

This is from an old Debian bug at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=437127

I'm slightly inferring what the configuration which trigger this issue is, the
bug report says:

This code however fails if no slash is present in the address, which is the
case in my configuration:

$ ip addr show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:16:17:90:b4:35 brd ff:ff:ff:ff:ff:ff
inet 88.198.12.XXX peer 88.198.12.XXX/32 brd 88.255.255.255 scope global eth0

I hope either Marc or Stefan can correct me if I have surmised wrongly what
this configuration represents.

This function is used in the vif-route configuration.

Signed-off-by: Ian Campbell <ian.campbell [at] citrix>

diff -r 54384951de02 -r ca5c30605279 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 15:06:13 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 "$1" | awk '$3 == "inet" {split($4,i,"/"); print i[1]; exit}'
}





_______________________________________________
Xen-devel mailing list
Xen-devel [at] lists
http://lists.xen.org/xen-devel


Ian.Campbell at citrix

Jul 24, 2012, 1:53 AM

Post #4 of 6 (54 views)
Permalink
Re: [PATCH] hotplug: fix ip_of for systems using peer-to-peer link [In reply to]

Anyone object to or ack this patch?

On Tue, 2012-07-10 at 15:05 +0100, Ian Campbell wrote:

> 8<---------------------------------
>
> # HG changeset patch
> # User Ian Campbell <ian.campbell [at] citrix>
> # Date 1341929173 -3600
> # Node ID ca5c306052791edf6d96da3f80aecd750b86a5e4
> # Parent 54384951de02e2db909116d64aa6a65d06ffa708
> hotplug: fix ip_of for systems using a peer-to-peer link
>
> This is from an old Debian bug at
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=437127
>
> I'm slightly inferring what the configuration which trigger this issue is, the
> bug report says:
>
> This code however fails if no slash is present in the address, which is the
> case in my configuration:
>
> $ ip addr show dev eth0
> 2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
> link/ether 00:16:17:90:b4:35 brd ff:ff:ff:ff:ff:ff
> inet 88.198.12.XXX peer 88.198.12.XXX/32 brd 88.255.255.255 scope global eth0
>
> I hope either Marc or Stefan can correct me if I have surmised wrongly what
> this configuration represents.
>
> This function is used in the vif-route configuration.
>
> Signed-off-by: Ian Campbell <ian.campbell [at] citrix>
>
> diff -r 54384951de02 -r ca5c30605279 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 15:06:13 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 "$1" | awk '$3 == "inet" {split($4,i,"/"); print i[1]; exit}'
> }
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel [at] lists
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel [at] lists
http://lists.xen.org/xen-devel


Ian.Jackson at eu

Jul 24, 2012, 4:24 AM

Post #5 of 6 (54 views)
Permalink
Re: [PATCH] hotplug: fix ip_of for systems using peer-to-peer link [In reply to]

Ian Campbell writes ("Re: [Xen-devel] [PATCH] hotplug: fix ip_of for systems using peer-to-peer link"):
> Anyone object to or ack this patch?
>
> On Tue, 2012-07-10 at 15:05 +0100, Ian Campbell wrote:
>
> > 8<---------------------------------
> >
> > # HG changeset patch
> > # User Ian Campbell <ian.campbell [at] citrix>
> > # Date 1341929173 -3600
> > # Node ID ca5c306052791edf6d96da3f80aecd750b86a5e4
> > # Parent 54384951de02e2db909116d64aa6a65d06ffa708
> > hotplug: fix ip_of for systems using a peer-to-peer link

Acked-by: Ian Jackson <ian.jackson [at] eu>

_______________________________________________
Xen-devel mailing list
Xen-devel [at] lists
http://lists.xen.org/xen-devel


Ian.Campbell at citrix

Jul 25, 2012, 9:45 AM

Post #6 of 6 (52 views)
Permalink
Re: [PATCH] hotplug: fix ip_of for systems using peer-to-peer link [In reply to]

Control: tags -1 +fixed-upstream

On Tue, 2012-07-24 at 12:24 +0100, Ian Jackson wrote:
> Ian Campbell writes ("Re: [Xen-devel] [PATCH] hotplug: fix ip_of for systems using peer-to-peer link"):
> > Anyone object to or ack this patch?
> >
> > On Tue, 2012-07-10 at 15:05 +0100, Ian Campbell wrote:
> >
> > > 8<---------------------------------
> > >
> > > # HG changeset patch
> > > # User Ian Campbell <ian.campbell [at] citrix>
> > > # Date 1341929173 -3600
> > > # Node ID ca5c306052791edf6d96da3f80aecd750b86a5e4
> > > # Parent 54384951de02e2db909116d64aa6a65d06ffa708
> > > hotplug: fix ip_of for systems using a peer-to-peer link
>
> Acked-by: Ian Jackson <ian.jackson [at] eu>

Applied, thanks.



_______________________________________________
Xen-devel mailing list
Xen-devel [at] lists
http://lists.xen.org/xen-devel

Xen devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.