Blame SOURCES/0004-Revert-redhat-remove-files-that-we-no-longer-use.patch

486e17
From a3fcedf3c4fd338e87ce9728e43b62fd7ede8f7c Mon Sep 17 00:00:00 2001
486e17
From: Jarod Wilson <jarod@redhat.com>
486e17
Date: Wed, 20 Jun 2018 16:22:05 -0400
486e17
Subject: [PATCH rdma-core] Revert "redhat: remove files that we no longer use"
486e17
486e17
This reverts commit d6d2396af1b8737b9f003ea45d55dc31d87c5611.
486e17
486e17
Upstream doesn't need them, but RHEL7.x does, as people do still bypass
486e17
NetworkManager and bring up interfaces using SysV-initscripts type things.
486e17
486e17
Signed-off-by: Jarod Wilson <jarod@redhat.com>
486e17
---
486e17
 redhat/rdma.ifdown-ib | 183 ++++++++++++++++++++++++++++++
486e17
 redhat/rdma.ifup-ib   | 308 ++++++++++++++++++++++++++++++++++++++++++++++++++
486e17
 2 files changed, 491 insertions(+)
486e17
 create mode 100644 redhat/rdma.ifdown-ib
486e17
 create mode 100644 redhat/rdma.ifup-ib
486e17
486e17
diff --git a/redhat/rdma.ifdown-ib b/redhat/rdma.ifdown-ib
486e17
new file mode 100644
486e17
index 00000000..1cb284dc
486e17
--- /dev/null
486e17
+++ b/redhat/rdma.ifdown-ib
486e17
@@ -0,0 +1,183 @@
486e17
+#!/bin/bash
486e17
+# Network Interface Configuration System
486e17
+# Copyright (c) 1996-2013 Red Hat, Inc. all rights reserved.
486e17
+#
486e17
+# This program is free software; you can redistribute it and/or modify
486e17
+# it under the terms of the GNU General Public License, version 2,
486e17
+# as published by the Free Software Foundation.
486e17
+#
486e17
+# This program is distributed in the hope that it will be useful,
486e17
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
486e17
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
486e17
+# GNU General Public License for more details.
486e17
+#
486e17
+# You should have received a copy of the GNU General Public License
486e17
+# along with this program; if not, write to the Free Software
486e17
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
486e17
+
486e17
+. /etc/init.d/functions
486e17
+
486e17
+cd /etc/sysconfig/network-scripts
486e17
+. ./network-functions
486e17
+
486e17
+[ -f ../network ] && . ../network
486e17
+
486e17
+CONFIG=${1}
486e17
+
486e17
+source_config
486e17
+
486e17
+# Allow the user to override the detection of our physical device by passing
486e17
+# it in.  No checking is done, if the user gives us a bogus dev, it's
486e17
+# their problem.
486e17
+[ -n "${PHYSDEV}" ] && REALDEVICE="$PHYSDEV"
486e17
+
486e17
+. /etc/sysconfig/network
486e17
+
486e17
+# Check to make sure the device is actually up
486e17
+check_device_down ${DEVICE} && exit 0
486e17
+
486e17
+# If we are a P_Key device, we need to munge a few things
486e17
+if [ "${PKEY}" = yes ]; then
486e17
+	[ -z "${PKEY_ID}" ] && {
486e17
+	        net_log $"InfiniBand IPoIB device: PKEY=yes requires a PKEY_ID"
486e17
+	        exit 1
486e17
+	}
486e17
+	[ -z "${PHYSDEV}" ] && {
486e17
+	        net_log $"InfiniBand IPoIB device: PKEY=yes requires a PHYSDEV"
486e17
+	        exit 1
486e17
+	}
486e17
+	# Normalize our PKEY_ID to have the high bit set
486e17
+	NEW_PKEY_ID=`printf "0x%04x" $(( 0x8000 | ${PKEY_ID} ))`
486e17
+	NEW_PKEY_NAME=`printf "%04x" ${NEW_PKEY_ID}`
486e17
+	[ "${DEVICE}" != "${PHYSDEV}.${NEW_PKEY_NAME}" ] && {
486e17
+                net_log $"Configured DEVICE name does not match what new device name would be.  This
486e17
+is most likely because once the PKEY_ID was normalized, it no longer
486e17
+resulted in the expected device naming, and so the DEVICE entry in the
486e17
+config file needs to be updated to match. This can also be caused by
486e17
+giving PKEY_ID as a hex number but without using the mandatory 0x prefix.
486e17
+	Configured DEVICE=$DEVICE
486e17
+        Configured PHYSDEV=$PHYSDEV
486e17
+        Configured PKEY_ID=$PKEY_ID
486e17
+        Calculated PKEY_ID=$NEW_PKEY_ID
486e17
+        Calculated name=${PHYSDEV}.${NEW_PKEY_NAME}"
486e17
+                exit 1
486e17
+        }
486e17
+        [ -d "/sys/class/net/${DEVICE}" ] || exit 0
486e17
+        # When we get to downing the IP address, we need REALDEVICE to
486e17
+        # point to our PKEY device
486e17
+        REALDEVICE="${DEVICE}"
486e17
+fi
486e17
+
486e17
+
486e17
+if [ "${SLAVE}" != "yes" -o -z "${MASTER}" ]; then
486e17
+if [ -n "${HWADDR}" -a -z "${MACADDR}" ]; then
486e17
+    HWADDR=$(echo $HWADDR | tail -c 24)
486e17
+    FOUNDMACADDR=$(get_hwaddr ${REALDEVICE} | tail -c 24)
486e17
+    if [ -n "${FOUNDMACADDR}" -a "${FOUNDMACADDR}" != "${HWADDR}" ]; then
486e17
+        NEWCONFIG=$(get_config_by_hwaddr ${FOUNDMACADDR})
486e17
+	if [ -n "${NEWCONFIG}" ]; then
486e17
+	   eval $(LANG=C grep -F "DEVICE=" $NEWCONFIG)
486e17
+	else
486e17
+	   net_log $"Device ${DEVICE} has MAC address ${FOUNDMACADDR}, instead of configured address ${HWADDR}. Ignoring."
486e17
+	   exit 1
486e17
+	fi
486e17
+	if [ -n "${NEWCONFIG}" -a "${NEWCONFIG##*/}" != "${CONFIG##*/}" -a "${DEVICE}" = "${REALDEVICE}" ]; then
486e17
+	   exec /sbin/ifdown ${NEWCONFIG}
486e17
+	else
486e17
+	   net_log $"Device ${DEVICE} has MAC address ${FOUNDMACADDR}, instead of configured address ${HWADDR}. Ignoring."
486e17
+	   exit 1
486e17
+	fi
486e17
+    fi
486e17
+fi
486e17
+fi
486e17
+
486e17
+if is_bonding_device ${DEVICE} ; then
486e17
+    for device in $(LANG=C grep -l "^[[:space:]]*MASTER=\"\?${DEVICE}\"\?\([[:space:]#]\|$\)" /etc/sysconfig/network-scripts/ifcfg-*) ; do
486e17
+	is_ignored_file "$device" && continue
486e17
+	/sbin/ifdown ${device##*/}
486e17
+    done
486e17
+    for arg in $BONDING_OPTS ; do
486e17
+	key=${arg%%=*};
486e17
+	[[ "${key}" != "arp_ip_target" ]] && continue
486e17
+	value=${arg##*=};
486e17
+	if [ "${value:0:1}" != "" ]; then
486e17
+            OLDIFS=$IFS;
486e17
+            IFS=',';
486e17
+            for arp_ip in $value; do
486e17
+		if grep -q $arp_ip /sys/class/net/${DEVICE}/bonding/arp_ip_target; then
486e17
+                    echo "-$arp_ip" > /sys/class/net/${DEVICE}/bonding/arp_ip_target
486e17
+		fi
486e17
+            done
486e17
+            IFS=$OLDIFS;
486e17
+	else
486e17
+	    value=${value#+};
486e17
+	    if grep -q $value /sys/class/net/${DEVICE}/bonding/arp_ip_target; then
486e17
+                echo "-$value" > /sys/class/net/${DEVICE}/bonding/arp_ip_target
486e17
+	    fi
486e17
+	fi
486e17
+    done
486e17
+fi
486e17
+
486e17
+/etc/sysconfig/network-scripts/ifdown-ipv6 ${CONFIG}
486e17
+
486e17
+retcode=0
486e17
+[ -n "$(pidof -x dhclient)" ] && {
486e17
+   for VER in "" 6 ; do
486e17
+	if [ -f "/var/run/dhclient$VER-${DEVICE}.pid" ]; then
486e17
+		dhcpid=$(cat /var/run/dhclient$VER-${DEVICE}.pid)
486e17
+		generate_lease_file_name $VER
486e17
+		if [[ "$DHCPRELEASE" = [yY1]* ]];  then
486e17
+			/sbin/dhclient -r -lf ${LEASEFILE} -pf /var/run/dhclient$VER-${DEVICE}.pid ${DEVICE} >/dev/null 2>&1
486e17
+			retcode=$?
486e17
+		else
486e17
+			kill $dhcpid >/dev/null 2>&1
486e17
+			retcode=$?
486e17
+			reason=STOP$VER interface=${DEVICE} /sbin/dhclient-script
486e17
+		fi
486e17
+		if [ -f "/var/run/dhclient$VER-${DEVICE}.pid" ]; then
486e17
+			rm -f /var/run/dhclient$VER-${DEVICE}.pid
486e17
+			kill $dhcpid >/dev/null 2>&1
486e17
+		fi
486e17
+	fi
486e17
+    done
486e17
+}
486e17
+# we can't just delete the configured address because that address
486e17
+# may have been changed in the config file since the device was
486e17
+# brought up.  Flush all addresses associated with this
486e17
+# instance instead.
486e17
+if [ -d "/sys/class/net/${REALDEVICE}" ]; then
486e17
+	if [ "${REALDEVICE}" = "${DEVICE}" ]; then
486e17
+		ip addr flush dev ${REALDEVICE} scope global 2>/dev/null
486e17
+	else
486e17
+		ip addr flush dev ${REALDEVICE} label ${DEVICE} scope global 2>/dev/null
486e17
+	fi
486e17
+
486e17
+	if [ "${SLAVE}" = "yes" -a -n "${MASTER}" ]; then
486e17
+		echo "-${DEVICE}" > /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null
486e17
+	fi
486e17
+
486e17
+	if [ "${REALDEVICE}" = "${DEVICE}" ]; then
486e17
+		ip link set dev ${DEVICE} down 2>/dev/null
486e17
+	fi
486e17
+fi
486e17
+[ "$retcode" = "0" ] && retcode=$?
486e17
+
486e17
+# wait up to 5 seconds for device to actually come down...
486e17
+waited=0
486e17
+while ! check_device_down ${DEVICE} && [ "$waited" -lt 50 ] ; do
486e17
+    usleep 10000
486e17
+    waited=$(($waited+1))
486e17
+done
486e17
+
486e17
+if [ "$retcode" = 0 ] ; then
486e17
+    /etc/sysconfig/network-scripts/ifdown-post $CONFIG
486e17
+    # do NOT use $? because ifdown should return whether or not
486e17
+    # the interface went down.
486e17
+fi
486e17
+
486e17
+if [ -n "$PKEY" ]; then
486e17
+    # PKey PKEY
486e17
+    echo "$NEW_PKEY_ID" > /sys/class/net/${PHYSDEV}/delete_child
486e17
+fi
486e17
+
486e17
+exit $retcode
486e17
diff --git a/redhat/rdma.ifup-ib b/redhat/rdma.ifup-ib
486e17
new file mode 100644
486e17
index 00000000..bb4d4f71
486e17
--- /dev/null
486e17
+++ b/redhat/rdma.ifup-ib
486e17
@@ -0,0 +1,308 @@
486e17
+#!/bin/bash
486e17
+# Network Interface Configuration System
486e17
+# Copyright (c) 1996-2013 Red Hat, Inc. all rights reserved.
486e17
+#
486e17
+# This program is free software; you can redistribute it and/or modify
486e17
+# it under the terms of the GNU General Public License, version 2,
486e17
+# as published by the Free Software Foundation.
486e17
+#
486e17
+# This program is distributed in the hope that it will be useful,
486e17
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
486e17
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
486e17
+# GNU General Public License for more details.
486e17
+#
486e17
+# You should have received a copy of the GNU General Public License
486e17
+# along with this program; if not, write to the Free Software
486e17
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
486e17
+
486e17
+. /etc/init.d/functions
486e17
+
486e17
+cd /etc/sysconfig/network-scripts
486e17
+. ./network-functions
486e17
+
486e17
+[ -f ../network ] && . ../network
486e17
+
486e17
+CONFIG="${1}"
486e17
+
486e17
+need_config "${CONFIG}"
486e17
+
486e17
+source_config
486e17
+
486e17
+# Allow the user to override the detection of our physical device by passing
486e17
+# it in.  No checking is done, if the user gives us a bogus dev, it's
486e17
+# their problem.
486e17
+[ -n "${PHYSDEV}" ] && REALDEVICE="$PHYSDEV"
486e17
+
486e17
+if [ "${BOOTPROTO}" = "dhcp" ]; then
486e17
+    DYNCONFIG=true
486e17
+fi
486e17
+
486e17
+# load the module associated with that device
486e17
+# /sbin/modprobe ${REALDEVICE}
486e17
+is_available_wait ${REALDEVICE} ${DEVTIMEOUT}
486e17
+
486e17
+# bail out, if the MAC does not fit
486e17
+if [ -n "${HWADDR}" ]; then
486e17
+	FOUNDMACADDR=$(get_hwaddr ${REALDEVICE} | tail -c 24)
486e17
+	HWADDR=$(echo $HWADDR | tail -c 24)
486e17
+	if [ "${FOUNDMACADDR}" != "${HWADDR}" ]; then
486e17
+		net_log $"Device ${DEVICE} has different MAC address than expected, ignoring."
486e17
+		exit 1
486e17
+	fi
486e17
+fi
486e17
+
486e17
+# now check the real state
486e17
+is_available ${REALDEVICE} || {
486e17
+      if [ -n "$alias" ]; then
486e17
+         net_log $"$alias device ${DEVICE} does not seem to be present, delaying initialization."
486e17
+      else
486e17
+         net_log $"Device ${DEVICE} does not seem to be present, delaying initialization."
486e17
+      fi
486e17
+      exit 1
486e17
+}
486e17
+
486e17
+# if we are a P_Key device, create the device if needed
486e17
+if [ "${PKEY}" = yes ]; then
486e17
+	[ -z "${PKEY_ID}" ] && {
486e17
+		net_log $"InfiniBand IPoIB device: PKEY=yes requires a PKEY_ID"
486e17
+		exit 1
486e17
+	}
486e17
+	[ -z "${PHYSDEV}" ] && {
486e17
+		net_log $"InfiniBand IPoIB device: PKEY=yes requires a PHYSDEV"
486e17
+		exit 1
486e17
+	}
486e17
+	# Normalize our PKEY_ID to have the high bit set
486e17
+	NEW_PKEY_ID=`printf "0x%04x" $(( 0x8000 | ${PKEY_ID} ))`
486e17
+	NEW_PKEY_NAME=`printf "%04x" ${NEW_PKEY_ID}`
486e17
+	[ "${DEVICE}" != "${PHYSDEV}.${NEW_PKEY_NAME}" ] && {
486e17
+		net_log $"Configured DEVICE name does not match what new device name would be.  This
486e17
+is most likely because once the PKEY_ID was normalized, it no longer
486e17
+resulted in the expected device naming, and so the DEVICE entry in the
486e17
+config file needs to be updated to match. This can also be caused by
486e17
+giving PKEY_ID as a hex number but without using the mandatory 0x prefix.
486e17
+	Configured DEVICE=$DEVICE
486e17
+	Configured PHYSDEV=$PHYSDEV
486e17
+	Configured PKEY_ID=$PKEY_ID
486e17
+	Calculated PKEY_ID=$NEW_PKEY_ID
486e17
+	Calculated name=${PHYSDEV}.${NEW_PKEY_NAME}"
486e17
+		exit 1
486e17
+	}
486e17
+	[ -d "/sys/class/net/${DEVICE}" ] ||
486e17
+		echo "${NEW_PKEY_ID}" > "/sys/class/net/${PHYSDEV}/create_child"
486e17
+	[ -d "/sys/class/net/${DEVICE}" ] || {
486e17
+		echo "Failed to create child device $NEW_PKEY_ID of $PHYSDEV"
486e17
+		exit 1
486e17
+	}
486e17
+	# When we get to setting up the IP address, we need REALDEVICE to
486e17
+	# point to our new PKEY device
486e17
+	REALDEVICE="${DEVICE}"
486e17
+fi
486e17
+
486e17
+
486e17
+if [ -n "${MACADDR}" ]; then
486e17
+    net_log $"IPoIB devices do not support setting the MAC address of the interface"
486e17
+    # ip link set dev ${DEVICE} address ${MACADDR}
486e17
+fi
486e17
+
486e17
+# First, do we even support setting connected mode?
486e17
+if [ -e /sys/class/net/${DEVICE}/mode ]; then
486e17
+    # OK, set the mode in all cases, that way it gets reset on a down/up
486e17
+    # cycle, allowing people to change the mode without rebooting
486e17
+    if [ "${CONNECTED_MODE}" = yes ]; then
486e17
+        echo connected > /sys/class/net/${DEVICE}/mode
486e17
+	# cap the MTU where we should based upon mode
486e17
+	[ -z "$MTU" ] && MTU=65520
486e17
+	[ "$MTU" -gt 65520 ] && MTU=65520
486e17
+    else
486e17
+        echo datagram > /sys/class/net/${DEVICE}/mode
486e17
+	# cap the MTU where we should based upon mode
486e17
+	[ -z "$MTU" ] && MTU=2044
486e17
+	[ "$MTU" -gt 2044 ] && MTU=2044
486e17
+    fi
486e17
+fi
486e17
+
486e17
+if [ -n "${MTU}" ]; then
486e17
+    ip link set dev ${DEVICE} mtu ${MTU}
486e17
+fi
486e17
+
486e17
+# slave device?
486e17
+if [ "${SLAVE}" = yes -a "${ISALIAS}" = no -a "${MASTER}" != "" ]; then
486e17
+    install_bonding_driver ${MASTER}
486e17
+    grep -wq "${DEVICE}" /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null || {
486e17
+	/sbin/ip link set dev ${DEVICE} down
486e17
+	echo "+${DEVICE}" > /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null
486e17
+    }
486e17
+    ethtool_set
486e17
+
486e17
+    exit 0
486e17
+fi
486e17
+
486e17
+# Bonding initialization. For DHCP, we need to enslave the devices early,
486e17
+# so it can actually get an IP.
486e17
+if [ "$ISALIAS" = no ] && is_bonding_device ${DEVICE} ; then
486e17
+    install_bonding_driver ${DEVICE}
486e17
+    /sbin/ip link set dev ${DEVICE} up
486e17
+    for device in $(LANG=C grep -l "^[[:space:]]*MASTER=\"\?${DEVICE}\"\?\([[:space:]#]\|$\)" /etc/sysconfig/network-scripts/ifcfg-*) ; do
486e17
+	    is_ignored_file "$device" && continue
486e17
+	    /sbin/ifup ${device##*/}
486e17
+    done
486e17
+
486e17
+    [ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY}
486e17
+
486e17
+    # add the bits to setup the needed post enslavement parameters
486e17
+    for arg in $BONDING_OPTS ; do
486e17
+        key=${arg%%=*};
486e17
+        value=${arg##*=};
486e17
+	if [ "${key}" = "primary" ]; then
486e17
+            echo $value > /sys/class/net/${DEVICE}/bonding/$key
486e17
+	fi
486e17
+    done
486e17
+fi
486e17
+
486e17
+
486e17
+if [ -n "${DYNCONFIG}" ] && [ -x /sbin/dhclient ]; then
486e17
+    if [[ "${PERSISTENT_DHCLIENT}" =  [yY1]* ]]; then
486e17
+       ONESHOT="";
486e17
+    else
486e17
+       ONESHOT="-1";
486e17
+    fi;
486e17
+    generate_config_file_name
486e17
+    generate_lease_file_name
486e17
+    DHCLIENTARGS="${DHCLIENTARGS} -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${ONESHOT} -q ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /var/run/dhclient-${DEVICE}.pid"
486e17
+    echo
486e17
+    echo -n $"Determining IP information for ${DEVICE}..."
486e17
+    if [[ "${PERSISTENT_DHCLIENT}" !=  [yY1]* ]] && check_link_down ${DEVICE}; then
486e17
+	echo $" failed; no link present.  Check cable?"
486e17
+	exit 1
486e17
+    fi
486e17
+
486e17
+    ethtool_set
486e17
+
486e17
+    if /sbin/dhclient ${DHCLIENTARGS} ${DEVICE} ; then
486e17
+	echo $" done."
486e17
+	dhcpipv4="good"
486e17
+    else
486e17
+	echo $" failed."
486e17
+	if [[ "${IPV4_FAILURE_FATAL}"  = [Yy1]* ]] ; then
486e17
+	    exit 1
486e17
+	fi
486e17
+	if [[ "$IPV6INIT" != [yY1]* && "$DHCPV6C" != [yY1]* ]] ; then
486e17
+	    exit 1
486e17
+	fi
486e17
+	net_log "Unable to obtain IPv4 DHCP address ${DEVICE}." warning
486e17
+    fi
486e17
+# end dynamic device configuration
486e17
+else
486e17
+    if [ -z "${IPADDR}" -a -z "${IPADDR0}" -a -z "${IPADDR1}" -a -z "${IPADDR2}" ]; then
486e17
+         # enable device without IP, useful for e.g. PPPoE
486e17
+	 ip link set dev ${REALDEVICE} up
486e17
+	 ethtool_set
486e17
+	 [ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY}
486e17
+    else
486e17
+
486e17
+    expand_config
486e17
+
486e17
+    [ -n "${ARP}" ] && \
486e17
+	ip link set dev ${REALDEVICE} $(toggle_value arp $ARP)
486e17
+
486e17
+    if ! ip link set dev ${REALDEVICE} up ; then
486e17
+	net_log $"Failed to bring up ${DEVICE}."
486e17
+	exit 1
486e17
+    fi
486e17
+
486e17
+    ethtool_set
486e17
+
486e17
+    [ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY}
486e17
+
486e17
+    if [ "${DEVICE}" = "lo" ]; then
486e17
+        SCOPE="scope host"
486e17
+    else
486e17
+        SCOPE=${SCOPE:-}
486e17
+    fi
486e17
+
486e17
+    if [ -n "$SRCADDR" ]; then
486e17
+       SRC="src $SRCADDR"
486e17
+    else
486e17
+       SRC=
486e17
+    fi
486e17
+
486e17
+    # set IP address(es)
486e17
+    for idx in {0..256} ; do
486e17
+	if [ -z "${ipaddr[$idx]}" ]; then
486e17
+	    break
486e17
+	fi
486e17
+
486e17
+	if ! LC_ALL=C ip addr ls ${REALDEVICE} | LC_ALL=C grep -q "${ipaddr[$idx]}/${prefix[$idx]}" ; then
486e17
+	    [ "${REALDEVICE}" != "lo" ] && [ "${arpcheck[$idx]}" != "no" ] && \
486e17
+	    /sbin/arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${ipaddr[$idx]}
486e17
+	    if [ $? = 1 ]; then
486e17
+		net_log $"Error, some other host already uses address ${ipaddr[$idx]}."
486e17
+		exit 1
486e17
+	    fi
486e17
+
486e17
+	    if ! ip addr add ${ipaddr[$idx]}/${prefix[$idx]} \
486e17
+		brd ${broadcast[$idx]:-+} dev ${REALDEVICE} ${SCOPE} label ${DEVICE}; then
486e17
+		net_log $"Error adding address ${ipaddr[$idx]} for ${DEVICE}."
486e17
+	    fi
486e17
+	fi
486e17
+
486e17
+	if [ -n "$SRCADDR" ]; then
486e17
+           sysctl -w "net.ipv4.conf.${REALDEVICE}.arp_filter=1" >/dev/null 2>&1
486e17
+	fi
486e17
+
486e17
+	# update ARP cache of neighboring computers
486e17
+	if [ "${REALDEVICE}" != "lo" ]; then
486e17
+	    /sbin/arping -q -A -c 1 -I ${REALDEVICE} ${ipaddr[$idx]}
486e17
+	    ( sleep 2;
486e17
+	      /sbin/arping -q -U -c 1 -I ${REALDEVICE} ${ipaddr[$idx]} ) > /dev/null 2>&1 < /dev/null &
486e17
+	fi
486e17
+    done
486e17
+
486e17
+    # Set a default route.
486e17
+    if [ "${DEFROUTE}" != "no" ] && [ -z "${GATEWAYDEV}" -o "${GATEWAYDEV}" = "${REALDEVICE}" ]; then
486e17
+	# set up default gateway. replace if one already exists
486e17
+	if [ -n "${GATEWAY}" ] && [ "$(ipcalc --network ${GATEWAY} ${netmask[0]} 2>/dev/null)" = "NETWORK=${NETWORK}" ]; then
486e17
+	    ip route replace default ${METRIC:+metric $METRIC} \
486e17
+		via ${GATEWAY} ${WINDOW:+window $WINDOW} ${SRC} \
486e17
+		${GATEWAYDEV:+dev $GATEWAYDEV} ||
486e17
+			net_log $"Error adding default gateway ${GATEWAY} for ${DEVICE}."
486e17
+	elif [ "${GATEWAYDEV}" = "${DEVICE}" ]; then
486e17
+	    ip route replace default ${METRIC:+metric $METRIC} \
486e17
+		${SRC} ${WINDOW:+window $WINDOW} dev ${REALDEVICE} ||
486e17
+			net_log $"Erorr adding default gateway for ${REALDEVICE}."
486e17
+	fi
486e17
+    fi
486e17
+    fi
486e17
+fi
486e17
+
486e17
+# Add Zeroconf route.
486e17
+if [ -z "${NOZEROCONF}" -a "${ISALIAS}" = "no" -a "${REALDEVICE}" != "lo" ]; then
486e17
+    ip route add 169.254.0.0/16 dev ${REALDEVICE} metric $((1000 + $(cat /sys/class/net/${REALDEVICE}/ifindex))) scope link
486e17
+fi
486e17
+
486e17
+# Inform firewall which network zone (empty means default) this interface belongs to
486e17
+if [ -x /usr/bin/firewall-cmd -a "${REALDEVICE}" != "lo" ]; then
486e17
+    /usr/bin/firewall-cmd --zone="${ZONE}" --change-interface="${DEVICE}" > /dev/null 2>&1
486e17
+fi
486e17
+
486e17
+# IPv6 initialisation?
486e17
+/etc/sysconfig/network-scripts/ifup-ipv6 ${CONFIG}
486e17
+if [[ "${DHCPV6C}"  = [Yy1]* ]] && [ -x /sbin/dhclient ]; then
486e17
+    generate_config_file_name 6
486e17
+    generate_lease_file_name 6
486e17
+    echo
486e17
+    echo -n $"Determining IPv6 information for ${DEVICE}..."
486e17
+    if /sbin/dhclient -6 -1 ${DHCPV6C_OPTIONS} ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /var/run/dhclient6-${DEVICE}.pid -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${DEVICE} ; then
486e17
+        echo $" done."
486e17
+    else
486e17
+        echo $" failed."
486e17
+        if [ "${dhcpipv4}" = "good" -o -n "${IPADDR}" ]; then
486e17
+            net_log "Unable to obtain IPv6 DHCP address ${DEVICE}." warning
486e17
+        else
486e17
+            exit 1
486e17
+        fi
486e17
+    fi
486e17
+fi
486e17
+
486e17
+exec /etc/sysconfig/network-scripts/ifup-post ${CONFIG} ${2}
486e17
+
486e17
-- 
486e17
2.16.1
486e17