dcavalca / rpms / initscripts

Forked from rpms/initscripts 4 years ago
Clone

Blame SOURCES/initscripts-9.49.39-introduce-ARPUDATE.patch

52d5b2
From a81b5e8ec984ca2a8ee7167eb87f6fc9db737843 Mon Sep 17 00:00:00 2001
52d5b2
From: "David Kaspar [Dee'Kej]" <dkaspar@redhat.com>
52d5b2
Date: Mon, 10 Jul 2017 18:16:35 +0200
52d5b2
Subject: [PATCH] ARPUPDATE introduced
52d5b2
52d5b2
  The ARPUPDATE option has been introduced. It defaults to 'yes'.
52d5b2
52d5b2
  By setting the ARPUPDATE to 'no', administrator can disable
52d5b2
  updating neighbouring computers with ARP information about current
52d5b2
  NIC. This is especially needed when using LVS Load Balancing with
52d5b2
  Direct routing enabled.
52d5b2
---
52d5b2
 sysconfig.txt                               | 5 +++++
52d5b2
 sysconfig/network-scripts/ifup-aliases      | 4 +++-
52d5b2
 sysconfig/network-scripts/ifup-eth          | 2 +-
52d5b2
 sysconfig/network-scripts/network-functions | 6 ++++++
52d5b2
 4 files changed, 15 insertions(+), 2 deletions(-)
52d5b2
52d5b2
diff --git a/sysconfig.txt b/sysconfig.txt
52d5b2
index a4c05da..7adc381 100644
52d5b2
--- a/sysconfig.txt
52d5b2
+++ b/sysconfig.txt
52d5b2
@@ -586,6 +586,11 @@ Files in /etc/sysconfig/network-scripts/
52d5b2
       If set to 'no', ifup will not try to determine, if requested ip address
52d5b2
       is used by other machine in network.
52d5b2
       Defaults to 'yes'.
52d5b2
+    ARPUPDATE=yes|no
52d5b2
+      If set to 'no' the neighbours in current network will not be updated with
52d5b2
+      ARP information about this NIC. This is especially handy using LVS Load
52d5b2
+      Balancing with Direct Routing enabled.
52d5b2
+      Defaults to 'yes'.
52d5b2
     IPV4_FAILURE_FATAL=yes|no
52d5b2
       If set to yes, ifup-eth will end immediately after ipv4 dhclient fails.
52d5b2
       Defaults to 'no'.
52d5b2
diff --git a/sysconfig/network-scripts/ifup-aliases b/sysconfig/network-scripts/ifup-aliases
52d5b2
index fbc1547..52d43ea 100755
52d5b2
--- a/sysconfig/network-scripts/ifup-aliases
52d5b2
+++ b/sysconfig/network-scripts/ifup-aliases
52d5b2
@@ -127,6 +127,7 @@ eval ` (
52d5b2
     echo default_GATEWAY=$GATEWAY\;;
52d5b2
     echo default_NO_ALIASROUTING=$NO_ALIASROUTING\;;
52d5b2
     echo default_ARPCHECK=$ARPCHECK\;;
52d5b2
+    echo default_ARPUPDATE=$ARPUPDATE\;;
52d5b2
 ) `
52d5b2
 [ -z "$default_GATEWAY" ] && default_GATEWAY=$network_GATEWAY
52d5b2
 
52d5b2
@@ -142,6 +143,7 @@ function ini_env ()
52d5b2
     NO_ALIASROUTING=$default_NO_ALIASROUTING
52d5b2
     ONPARENT=""
52d5b2
     ARPCHECK=$default_ARPCHECK
52d5b2
+    ARPUPDATE=$default_ARPUPDATE
52d5b2
 }
52d5b2
 
52d5b2
 function is_default_gateway ()
52d5b2
@@ -279,7 +281,7 @@ function new_interface ()
52d5b2
             dev ${parent_device} label ${DEVICE}
52d5b2
 
52d5b2
         # update ARP cache of neighboring computers:
52d5b2
-        if [ "${REALDEVICE}" != "lo" ]; then
52d5b2
+        if ! is_false "${ARPUPDATE}" && [ "${REALDEVICE}" != "lo" ]; then
52d5b2
             /sbin/arping -q -A -c 1 -I ${parent_device} ${IPADDR}
52d5b2
             ( sleep 2; /sbin/arping -q -U -c 1 -I ${parent_device} ${IPADDR} ) > /dev/null 2>&1 < /dev/null &
52d5b2
         fi
52d5b2
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth
52d5b2
index 3da5c16..5096a5d 100755
52d5b2
--- a/sysconfig/network-scripts/ifup-eth
52d5b2
+++ b/sysconfig/network-scripts/ifup-eth
52d5b2
@@ -274,7 +274,7 @@ else
52d5b2
             fi
52d5b2
 
52d5b2
             # update ARP cache of neighboring computers
52d5b2
-            if [ "${REALDEVICE}" != "lo" ]; then
52d5b2
+            if ! is_false "${arpupdate[$idx]}" && [ "${REALDEVICE}" != "lo" ]; then
52d5b2
                 /sbin/arping -q -A -c 1 -I ${REALDEVICE} ${ipaddr[$idx]}
52d5b2
                 ( sleep 2;
52d5b2
                 /sbin/arping -q -U -c 1 -I ${REALDEVICE} ${ipaddr[$idx]} ) > /dev/null 2>&1 < /dev/null &
52d5b2
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
52d5b2
index 1867c38..7f5dfb0 100644
52d5b2
--- a/sysconfig/network-scripts/network-functions
52d5b2
+++ b/sysconfig/network-scripts/network-functions
52d5b2
@@ -222,6 +222,7 @@ expand_config ()
52d5b2
         netmask[$i]=$(eval echo '$'NETMASK$idx)
52d5b2
         broadcast[$i]=$(eval echo '$'BROADCAST$idx)
52d5b2
         arpcheck[$i]=$(eval echo '$'ARPCHECK$idx)
52d5b2
+        arpupdate[$i]=$(eval echo '$'ARPUPDATE$idx)
52d5b2
 
52d5b2
         if [ "${prefix[$i]}x" != "x" ]; then
52d5b2
             val=$(/bin/ipcalc --netmask "${ipaddr[$i]}/${prefix[$i]}")
52d5b2
@@ -248,6 +249,11 @@ expand_config ()
52d5b2
             arpcheck[$i]=${arpcheck[$i],,*}
52d5b2
         fi
52d5b2
 
52d5b2
+        if [ "${arpupdate[$i]}x" != "x" ]; then
52d5b2
+            arpupdate[$i]=${arpupdate[$i]##ARPUPDATE=}
52d5b2
+            arpupdate[$i]=${arpupdate[$i],,*}
52d5b2
+        fi
52d5b2
+
52d5b2
         i=$((i+1))
52d5b2
     done
52d5b2
 
52d5b2
-- 
52d5b2
2.9.5
52d5b2