[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] Add default netmask to vif-nat


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: James Dykman <dykman@xxxxxxxxxx>
  • Date: Thu, 8 Dec 2005 15:41:53 -0500
  • Delivery-date: Thu, 08 Dec 2005 20:42:49 +0000
  • Importance: Normal
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Sensitivity:

If vif-nat is passed an IP address "10.1.1.27" instead of "10.1.1.27/16", 
bits is an empty string. This causes a syntax error on 
line 89 while setting intmask, and another "Hotplug scripts not working" 
error.

This patch adds a default value, though a case can be made for removing 
intmask, vif_int, netmask, and network since they
don't seem to be used for anything.

Signed-off-by: Jim Dykman <dykman@xxxxxxxxxx>

diff -r c9772105fead tools/examples/vif-nat
--- a/tools/examples/vif-nat    Thu Dec  8 15:04:41 2005
+++ b/tools/examples/vif-nat    Thu Dec  8 13:47:08 2005
@@ -81,7 +81,9 @@

 # Split the given IP/bits pair.
 vif_ip=`echo ${ip} | awk -F/ '{print $1}'`
-bits=`echo ${ip} | awk -F/ '{print $2}'`
+bits_or_nothing=`echo ${ip} | awk -F/ '{print $2}'`
+# Default to /24
+bits=${bits_or_nothing:-24}

 # Convert $bits and $vif_ip to integers, mask appropriately to get a 
network
 # address, and convert them both to dotted quads.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.