WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Add default netmask to vif-nat
From: James Dykman <dykman@xxxxxxxxxx>
Date: Thu, 8 Dec 2005 15:41:53 -0500
Delivery-date: Thu, 08 Dec 2005 20:42:49 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
Importance: Normal
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>