dcavalca / rpms / initscripts

Forked from rpms/initscripts 4 years ago
Clone

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

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