James Dykman
2006-Feb-22 20:47 UTC
[Xen-devel] [PATCH] >1 IP address on eth0 causes hotplug script failure
Adding a second IP address onto eth0 causes the vif-* hotplug scripts to fail: ip_of() is returning a LIST of IP addresses, one per line. The vif-scripts attempt to use the list where single addresses ought to be, with predictable results. This patch changes ip_of() to return the first address in the list, which seems to be the first one configured. This came up while testing the patch for the checksum errors on IPSEC tunnels. I added an IP address for the tunnel on eth0 and domUs wouldn''t start anymore. Since this changes vif-common.sh, I ran xm-test using -bridge, -route, and -nat scripts, each with 1 and 4 IP addresses on eth0. Signed-off-by: Jim Dykman <dykman@us.ibm.com> diff -r 57e6d7218427 tools/examples/vif-common.sh --- a/tools/examples/vif-common.sh Fri Feb 3 18:45:14 2006 +++ b/tools/examples/vif-common.sh Wed Feb 8 16:08:56 2006 @@ -125,7 +125,7 @@ # function ip_of() { - ip addr show "$1" | awk "/^.*inet.*$1\$/{print \$2}" | sed ''s,/.*,,'' + ip addr show "$1" | awk "/^.*inet.*$1\$/{print \$2}" | sed ''s,/.*,,'' | head -1 } Jim _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jeremy Katz
2006-Feb-22 20:52 UTC
Re: [Xen-devel] [PATCH] >1 IP address on eth0 causes hotplug script failure
On Wed, 2006-02-22 at 15:47 -0500, James Dykman wrote:> - ip addr show "$1" | awk "/^.*inet.*$1\$/{print \$2}" | sed ''s,/.*,,'' > + ip addr show "$1" | awk "/^.*inet.*$1\$/{print \$2}" | sed ''s,/.*,,'' | > head -1You really want ''head -n 1'' here. ''head -1'' is an obsolete syntax Jeremy _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ewan Mellor
2006-Feb-22 20:52 UTC
Re: [Xen-devel] [PATCH] >1 IP address on eth0 causes hotplug script failure
On Wed, Feb 22, 2006 at 03:47:38PM -0500, James Dykman wrote:> Adding a second IP address onto eth0 causes the vif-* hotplug scripts to > fail: ip_of() is returning a LIST of IP addresses, one per line. > The vif-scripts attempt to use the list where single addresses ought to > be, with predictable results. This patch changes ip_of() to return > the first address in the list, which seems to be the first one configured. > > This came up while testing the patch for the checksum errors on IPSEC > tunnels. I added an IP address for the tunnel on eth0 and > domUs wouldn''t start anymore. > > Since this changes vif-common.sh, I ran xm-test using -bridge, -route, and > -nat scripts, each with 1 and 4 IP addresses on eth0. > > Signed-off-by: Jim Dykman <dykman@us.ibm.com>Applied, thank you. Ewan. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel