Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-cloud / recipes-support / cluster-resource-agents / resource-agents / stx / ipaddr2-use-host-scope-for-addresses-on-loopback.patch
1 From a39c83dbaf4054cc96cd4a0a2b671509dd10af28 Mon Sep 17 00:00:00 2001
2 From: Bart Wensley <barton.wensley@windriver.com>
3 Date: Wed, 21 Nov 2018 12:14:20 -0600
4 Subject: [PATCH 1/1] ipaddr2 use host scope for addresses on loopback
5
6 ---
7  heartbeat/IPaddr2 | 12 ++++++++++--
8  1 file changed, 10 insertions(+), 2 deletions(-)
9
10 diff --git a/heartbeat/IPaddr2 b/heartbeat/IPaddr2
11 index 2da5c5e..79dbdcf 100755
12 --- a/heartbeat/IPaddr2
13 +++ b/heartbeat/IPaddr2
14 @@ -622,10 +622,18 @@ add_interface () {
15             add_ipv6_addrlabel $ipaddr
16         fi
17  
18 -       cmd="$IP2UTIL -f $FAMILY addr add $ipaddr/$netmask dev $iface"
19 +       # Addresses assigned to the loopback interfaces must be assigned
20 +       # using the host scope or assignment is prevented (can't have
21 +       # multiple global scope addresses on the loopback interface).
22 +       if [ "$iface" = "lo" ] ;then
23 +           option="scope host"
24 +       else
25 +           option=""
26 +       fi
27 +       cmd="$IP2UTIL -f $FAMILY addr add $ipaddr/$netmask dev $iface $option"
28         msg="Adding $FAMILY address $ipaddr/$netmask to device $iface"
29         if [ "$broadcast" != "none" ]; then
30 -               cmd="$IP2UTIL -f $FAMILY addr add $ipaddr/$netmask brd $broadcast dev $iface"
31 +               cmd="$IP2UTIL -f $FAMILY addr add $ipaddr/$netmask brd $broadcast dev $iface $option"
32                 msg="Adding $FAMILY address $ipaddr/$netmask with broadcast address $broadcast to device $iface"
33         fi
34  
35 -- 
36 1.8.3.1
37