1 From: Bartosz Kupidura <bkupidura@mirantis.com>
2 Date: Mon, 27 Jun 2016 13:12:29 +0200
3 Subject: [PATCH] Set net.ipv4.ip_nonlocal_bind=1 for vrouter namespace
5 Change-Id: I123af7e3b53f9a53fcd9d2818640c0bd4699e024
7 (cherry picked from commit 244456a3b77074a6cd85fa9d33ebb03ac25decf8)
9 files/fuel-ha-utils/ocf/ns_dns | 3 ++-
10 files/fuel-ha-utils/ocf/ns_vrouter | 3 ++-
11 2 files changed, 4 insertions(+), 2 deletions(-)
13 diff --git a/files/fuel-ha-utils/ocf/ns_dns b/files/fuel-ha-utils/ocf/ns_dns
14 index cdd814c..49cbd17 100644
15 --- a/files/fuel-ha-utils/ocf/ns_dns
16 +++ b/files/fuel-ha-utils/ocf/ns_dns
17 @@ -140,7 +140,7 @@ exit $OCF_SUCCESS
20 local ns=`ip netns list | grep "$OCF_RESKEY_ns"`
21 - [ $ns != $OCF_RESKEY_ns ] && return $OCF_ERR_GENERIC
22 + [ "$ns" != $OCF_RESKEY_ns ] && return $OCF_ERR_GENERIC
26 @@ -150,6 +150,7 @@ get_ns() {
28 ocf_run ip netns add $OCF_RESKEY_ns
30 + ocf_run $RUN_IN_NS /sbin/sysctl -w net.ipv4.ip_nonlocal_bind=1
31 ocf_run $RUN_IN_NS ip link set up dev lo
34 diff --git a/files/fuel-ha-utils/ocf/ns_vrouter b/files/fuel-ha-utils/ocf/ns_vrouter
35 index a65e9cf..5cc6c98 100644
36 --- a/files/fuel-ha-utils/ocf/ns_vrouter
37 +++ b/files/fuel-ha-utils/ocf/ns_vrouter
38 @@ -186,7 +186,7 @@ check_ns() {
39 local LH="${LL} check_ns():"
40 local ns=`ip netns list | grep "$OCF_RESKEY_ns"`
41 ocf_log debug "${LH} recieved netns list: ${ns}"
42 - [[ $ns != $OCF_RESKEY_ns ]] && return $OCF_ERR_GENERIC
43 + [[ "$ns" != $OCF_RESKEY_ns ]] && return $OCF_ERR_GENERIC
47 @@ -197,6 +197,7 @@ get_ns() {
49 ocf_run ip netns add $OCF_RESKEY_ns
51 + ocf_run $RUN_IN_NS /sbin/sysctl -w net.ipv4.ip_nonlocal_bind=1
52 ocf_run $RUN_IN_NS ip link set up dev lo
53 ocf_log debug "${LH} added netns ${OCF_RESKEY_ns} and set up lo"