Merge "Set ip_forward in vrouter namespace to 1 each monitor"

This commit is contained in:
Jenkins 2017-01-12 17:05:54 +00:00 committed by Gerrit Code Review
commit 02efbd2c68
1 changed files with 2 additions and 2 deletions

View File

@ -187,6 +187,7 @@ check_ns() {
local ns=$(ip netns list | awk "/${OCF_RESKEY_ns}/ {print \$1}")
ocf_log debug "${LH} recieved netns list: ${ns}"
[[ "$ns" != $OCF_RESKEY_ns ]] && return $OCF_ERR_GENERIC
ocf_run $RUN_IN_NS sysctl -w net.ipv4.ip_forward=1
return $OCF_SUCCESS
}
@ -198,6 +199,7 @@ get_ns() {
ocf_run ip netns add $OCF_RESKEY_ns
rc=$?
ocf_run $RUN_IN_NS /sbin/sysctl -w net.ipv4.ip_nonlocal_bind=1
ocf_run $RUN_IN_NS sysctl -w net.ipv4.ip_forward=1
ocf_run $RUN_IN_NS ip link set up dev lo
ocf_log debug "${LH} added netns ${OCF_RESKEY_ns} and set up lo"
@ -209,8 +211,6 @@ set_ns_routing() {
ip netns exec "${OCF_RESKEY_ns}" ip ${@}
}
ocf_run $RUN_IN_NS sysctl -w net.ipv4.ip_forward=1
# create host-ns veth pair unless it's present
ip link | grep -q '^[[:digit:]]\+:[[:space:]]\+'"${OCF_RESKEY_host_interface}"'[@:]'
if [ $? -gt 0 ]; then