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

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


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: James Dykman <dykman@xxxxxxxxxx>
  • Date: Fri, 9 Dec 2005 11:26:01 -0500
  • Delivery-date: Fri, 09 Dec 2005 16:27:04 +0000
  • Importance: Normal
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Sensitivity:

>Could you submit a patch removing the cruft, making sure that
>ip="10.1.1.27/16" and ip="10.1.1.27" both work?  Thanks.  I don't think 
that
>the former is meaningful in the vif-nat topology, but for backwards
>compatibility it would be good if both forms worked.

OK.

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    Fri Dec  9 10:18:35 2005
@@ -81,17 +81,6 @@
 
 # Split the given IP/bits pair.
 vif_ip=`echo ${ip} | awk -F/ '{print $1}'`
-bits=`echo ${ip} | awk -F/ '{print $2}'`
-
-# Convert $bits and $vif_ip to integers, mask appropriately to get a 
network
-# address, and convert them both to dotted quads.
-
-intmask=$(( (0xFFFFFFFF << (32 - $bits)) & 0xFFFFFFFF ))
-vif_int=$(( $(echo "((($vif_ip" | sed -e 's#\.#)\*256\+#g') ))
-
-netmask=$(dotted_quad $intmask)
-network=$(dotted_quad $(( $vif_int & $intmask )) )
-
 
 hostname=$(xenstore_read "$XENBUS_PATH/domain" | tr -- '_.:/+' '-----')
 if [ "$vifid" != "1" ]


Jim

_______________________________________________
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®.