From 3e70b145c45126593dd3b1116a82d3cd8bc18b87 Mon Sep 17 00:00:00 2001 From: Toshiaki Hatano Date: Tue, 29 Oct 2013 02:37:09 +0900 Subject: [PATCH] CLOUDSTACK-4967: vxlan doesn't scale - Fix inproper multicast address creation (when VNI > 65535) - Fix missing bride name in delete oparation Signed-off-by : Toshiaki Hatano --- scripts/vm/network/vnet/modifyvxlan.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/vm/network/vnet/modifyvxlan.sh b/scripts/vm/network/vnet/modifyvxlan.sh index 45d141a70db..a3ec71fa91f 100755 --- a/scripts/vm/network/vnet/modifyvxlan.sh +++ b/scripts/vm/network/vnet/modifyvxlan.sh @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. -# modifyvnet.sh -- adds and deletes VXLANs from a Routing Server +# modifyvxlan.sh -- adds and deletes VXLANs from a Routing Server # set -x ## TODO(VXLAN): MTU, IPv6 underlying @@ -30,7 +30,7 @@ addVxlan() { local pif=$2 local vxlanDev=vxlan$vxlanId local vxlanBr=$3 - local mcastGrp="239.$(( $vxlanId >> 16 % 256 )).$(( $vxlanId >> 8 % 256 )).$(( $vxlanId % 256 ))" + local mcastGrp="239.$(( ($vxlanId >> 16) % 256 )).$(( ($vxlanId >> 8) % 256 )).$(( $vxlanId % 256 ))" ## TODO(VXLAN): $brif (trafficlabel) should be passed from caller because we cannot assume 1:1 mapping between pif and brif. # lookup bridge interface @@ -133,7 +133,10 @@ deleteVxlan() { local pif=$2 local vxlanDev=vxlan$vxlanId local vxlanBr=$3 - local mcastGrp="239.$(( $vxlanId >> 16 % 256 )).$(( $vxlanId >> 8 % 256 )).$(( $vxlanId % 256 ))" + local mcastGrp="239.$(( ($vxlanId >> 16) % 256 )).$(( ($vxlanId >> 8) % 256 )).$(( $vxlanId % 256 ))" + + local sysfs_dir=/sys/devices/virtual/net/ + local brif=`find ${sysfs_dir}*/brif/ -name $pif | sed -e "s,$sysfs_dir,," | sed -e 's,/brif/.*$,,'` ip route del $mcastGrp/32 dev $brif