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 <haeena@haeena.net>
This commit is contained in:
Toshiaki Hatano 2013-10-29 02:37:09 +09:00
parent 7116268f33
commit 3e70b145c4
1 changed files with 6 additions and 3 deletions

View File

@ -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