[NFP] - Fixed service management network interface netmask in nfp-proxy namespace

Netmask for service management network interface in the nfp-proxy namespace is set
with reference to service management network subnet CIDR.

Change-Id: I6e574f27acd12d0005c28405f96d474800c06982
This commit is contained in:
Rajendra Machani 2016-09-28 15:12:29 +05:30 committed by Subrahmanyam Ongole
parent 17227f5559
commit d5a7488e5f
1 changed files with 6 additions and 3 deletions

View File

@ -423,7 +423,7 @@ def create_nfp_namespace_file():
filepx.write("\n\n\techo \"nfp-proxy cleaning success.... \"\n\n}")
filepx.write("\n\nfunction namespace_create {\n\n\tget_openstack_creds")
filepx.write("\n\tSERVICE_MGMT_GROUP=\"svc_management_ptg\"")
filepx.write("\n\tcidr=\"/24\"")
filepx.write("\n\tnetmask_bits=`neutron net-list --name l2p_$SERVICE_MGMT_GROUP -F subnets -f value | awk '{print $2}' | awk -F'/' '{print $2}'`")
filepx.write("\n\techo \"Creating new namespace nfp-proxy....\"")
filepx.write("\n\n\t#new namespace with name proxy")
filepx.write("\n\tNFP_P=`ip netns add nfp-proxy`")
@ -442,8 +442,11 @@ def create_nfp_namespace_file():
filepx.write("\n\tproxyPortIp=`neutron port-list | grep pt_nfp_proxy_pt"
" | awk '{print $11}' | sed 's/^\"\(.*\)\"}$/\\1/'`")
filepx.write("\n\ttapName=\"tap${proxyPortId:0:11}\"")
filepx.write("\n\tnew_ip_cidr=\"$proxyPortIp/24\"")
filepx.write("\n\tproxyBrd=`ipcalc -4 $proxyPortIp -m 255.255.255.0 -b"
filepx.write("\n\tnew_ip_cidr=\"$proxyPortIp/$netmask_bits\"")
filepx.write("\n\tset -- $(( 5 - ($netmask_bits / 8) )) 255 255 255 255 $(( (255 << (8 - ($netmask_bits % 8))) & 255 )) 0 0 0")
filepx.write("\n\t[ $1 -gt 1 ] && shift $1 || shift")
filepx.write("\n\tnetmask=${1-0}.${2-0}.${3-0}.${4-0}")
filepx.write("\n\tproxyBrd=`ipcalc -4 $proxyPortIp -m $netmask -b"
" | grep BROADCAST | awk -F '=' '{print $2}'`")
filepx.write("\n\n\t# Create a tap interface and add it"
" to the ovs bridge br-int")