You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by an...@apache.org on 2012/07/30 22:32:58 UTC

[1/2] git commit: CS-15680 : set broadcast IP

Updated Branches:
  refs/heads/vpc 9e5934260 -> f763f53c2


CS-15680 : set broadcast IP


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/f763f53c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/f763f53c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/f763f53c

Branch: refs/heads/vpc
Commit: f763f53c2da13849a333d936932e6c90fe35314b
Parents: 3aae979
Author: anthony <an...@cloud.com>
Authored: Mon Jul 30 12:24:07 2012 -0700
Committer: anthony <an...@cloud.com>
Committed: Mon Jul 30 13:24:33 2012 -0700

----------------------------------------------------------------------
 .../debian/config/opt/cloud/bin/vpc_guestnw.sh     |    2 +-
 .../debian/config/opt/cloud/bin/vpc_ipassoc.sh     |   10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f763f53c/patches/systemvm/debian/config/opt/cloud/bin/vpc_guestnw.sh
----------------------------------------------------------------------
diff --git a/patches/systemvm/debian/config/opt/cloud/bin/vpc_guestnw.sh b/patches/systemvm/debian/config/opt/cloud/bin/vpc_guestnw.sh
index c624c41..61c5a7e 100755
--- a/patches/systemvm/debian/config/opt/cloud/bin/vpc_guestnw.sh
+++ b/patches/systemvm/debian/config/opt/cloud/bin/vpc_guestnw.sh
@@ -115,7 +115,7 @@ desetup_usage() {
 create_guest_network() {
   logger -t cloud " $(basename $0): Create network on interface $dev,  gateway $gw, network $ip/$mask "
   # setup ip configuration
-  sudo ip addr add dev $dev $ip/$mask
+  sudo ip addr add dev $dev $ip/$mask brd +
   sudo ip link set $dev up
   sudo arping -c 3 -I $dev -A -U -s $ip $ip
   # setup rules to allow dhcp/dns request

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f763f53c/patches/systemvm/debian/config/opt/cloud/bin/vpc_ipassoc.sh
----------------------------------------------------------------------
diff --git a/patches/systemvm/debian/config/opt/cloud/bin/vpc_ipassoc.sh b/patches/systemvm/debian/config/opt/cloud/bin/vpc_ipassoc.sh
index 40c1e4d..8ef19e4 100755
--- a/patches/systemvm/debian/config/opt/cloud/bin/vpc_ipassoc.sh
+++ b/patches/systemvm/debian/config/opt/cloud/bin/vpc_ipassoc.sh
@@ -58,7 +58,7 @@ add_an_ip () {
   sudo ip link show $ethDev | grep "state DOWN" > /dev/null
   local old_state=$?
 
-  sudo ip addr add dev $ethDev $pubIp/$mask
+  sudo ip addr add dev $ethDev $pubIp/$mask brd +
   if [ $old_state -eq 0 ]
   then
     sudo ip link set $ethDev up
@@ -76,7 +76,7 @@ add_an_ip () {
 
 remove_an_ip () {
   logger -t cloud "$(basename $0):Removing ip $pubIp on interface $ethDev"
-  local existingIpMask=$(sudo ip addr show dev $ethDev | grep "inet " | awk '{print $2}')
+  local existingIpMask=$(sudo ip addr show dev $ethDev | grep -v "inet6" | grep "inet " | awk '{print $2}')
 
   sudo ip addr del dev $ethDev $pubIp/$mask
   # reapply IPs in this interface
@@ -86,7 +86,7 @@ remove_an_ip () {
     then
       continue
     fi
-    sudo ip addr add dev $ethDev $ipMask
+    sudo ip addr add dev $ethDev $ipMask brd +
   done
 
   remove_routing
@@ -148,14 +148,14 @@ fi
 
 if [ "$Aflag" == "1" ]
 then
-  add_an_ip  $publicIp  &&
+  add_an_ip
   unlock_exit $? $lock $locked
 fi
 
 
 if [ "$Dflag" == "1" ]
 then
-  remove_an_ip  $publicIp &&
+  remove_an_ip
   unlock_exit $? $lock $locked
 fi