aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifup-eth
diff options
context:
space:
mode:
Diffstat (limited to 'sysconfig/network-scripts/ifup-eth')
-rwxr-xr-xsysconfig/network-scripts/ifup-eth31
1 files changed, 14 insertions, 17 deletions
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth
index 4db7ba59..e51fdf53 100755
--- a/sysconfig/network-scripts/ifup-eth
+++ b/sysconfig/network-scripts/ifup-eth
@@ -66,10 +66,10 @@ if [ "${TYPE}" = "Bridge" ]; then
exit 1
fi
if [ ! -d /sys/class/net/${DEVICE}/bridge ]; then
- /usr/sbin/brctl addbr ${DEVICE} || exit 1
+ /usr/sbin/brctl addbr -- ${DEVICE} || exit 1
fi
- [ -n "${DELAY}" ] && /usr/sbin/brctl setfd ${DEVICE} ${DELAY}
- [ -n "${STP}" ] && /usr/sbin/brctl stp ${DEVICE} ${STP}
+ [ -n "${DELAY}" ] && /usr/sbin/brctl setfd -- ${DEVICE} ${DELAY}
+ [ -n "${STP}" ] && /usr/sbin/brctl stp -- ${DEVICE} ${STP}
# add the bits to setup driver parameters here
for arg in $BRIDGING_OPTS ; do
key=${arg%%=*};
@@ -212,14 +212,14 @@ if [ "$ISALIAS" = no ] && is_bonding_device ${DEVICE} ; then
if ! grep -q ${value#+} /sys/class/net/${DEVICE}/bonding/$key; then
echo "$value" > /sys/class/net/${DEVICE}/bonding/$key
fi
- else
+ elif [ "${key}" != "primary" ]; then
echo $value > /sys/class/net/${DEVICE}/bonding/$key
fi
done
/sbin/ip link set dev ${DEVICE} up
[ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY}
- for device in $(LANG=C egrep -l "^[[:space:]]*MASTER=\"?${DEVICE}\"?" /etc/sysconfig/network-scripts/ifcfg-*) ; do
+ for device in $(LANG=C egrep -l "^[[:space:]]*MASTER=\"?${DEVICE}\"?[[:space:]]*$" /etc/sysconfig/network-scripts/ifcfg-*) ; do
is_ignored_file "$device" && continue
/sbin/ifup ${device##*/}
done
@@ -237,13 +237,13 @@ fi
# If the device is part of a bridge, add the device to the bridge
if [ -n "${BRIDGE}" ] && [ -x /usr/sbin/brctl ]; then
if [ ! -d /sys/class/net/${BRIDGE}/bridge ]; then
- /usr/sbin/brctl addbr ${BRIDGE} 2>/dev/null
+ /usr/sbin/brctl addbr -- ${BRIDGE} 2>/dev/null
fi
/sbin/ip addr flush dev ${DEVICE} 2>/dev/null
/sbin/ip link set dev ${DEVICE} up
ethtool_set
[ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY}
- /usr/sbin/brctl addif ${BRIDGE} ${DEVICE}
+ /usr/sbin/brctl addif -- ${BRIDGE} ${DEVICE}
# add the bits to setup driver parameters here
for arg in $BRIDGING_OPTS ; do
key=${arg%%=*};
@@ -342,7 +342,9 @@ case $(basename $DHCP_CLIENT) in
else
ONESHOT="-1"
fi
- DHCP_ARGS="$DHCP_ARGS $ONESHOT -q -lf /var/lib/dhcp/dhclient-${DEVICE}.leases -pf /var/run/dhclient-${DEVICE}.pid -cf /etc/dhclient-${DEVICE}.conf $DEVICE"
+ generate_config_file_name
+ generate_lease_file_name
+ DHCP_ARGS="$DHCP_ARGS $ONESHOT -q ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /var/run/dhclient-${DEVICE}.pid $DEVICE"
if [ -n "$DHCP_HOSTNAME" ]; then
if [ ! -e /etc/dhclient-${DEVICE}.conf ] || ! grep -q "[^# ]*send *host-name" /etc/dhclient-${DEVICE}.conf; then
echo "send host-name \"${DHCP_HOSTNAME}\"; $BLURB" >> /etc/dhclient-${DEVICE}.conf
@@ -365,13 +367,6 @@ if [ -w /etc/dhclient-${DEVICE}.conf ] && [ -x /sbin/dhclient ] ; then
fi
if [ -n "${DYNCONFIG}" ]; then
- # copy any lease obtained by the initrd
- for file in /dev/.dhclient-${DEVICE}.leases /dev/.initramfs/net.${DEVICE}.lease /run/initramfs/net.${DEVICE}.lease; do
- if [ -f "${file}" ]; then
- mv -f $file /var/lib/dhclient/dhclient-${DEVICE}.leases
- [ -x /sbin/restorecon ] && restorecon /var/lib/dhclient/dhclient-${DEVICE}.leases > /dev/null 2>&1
- fi
- done
echo
echo -n $"Determining IP information for ${DEVICE}..."
if [[ "${PERSISTENT_DHCLIENT}" != [yY1]* ]] && check_link_down ${DEVICE}; then
@@ -450,7 +445,7 @@ else
fi
if ! LC_ALL=C ip addr ls ${REALDEVICE} | LC_ALL=C grep -q "${ipaddr[$idx]}/${prefix[$idx]}" ; then
- [ "${REALDEVICE}" != "lo" ] && \
+ [ "${REALDEVICE}" != "lo" ] && [ "${arpcheck[$idx]}" != "no" ] && \
if ! /sbin/arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${ipaddr[$idx]} ; then
net_log $"Error, some other host already uses address ${ipaddr[$idx]}."
mdv-network-event connection_failure ${DEVICE}
@@ -507,7 +502,9 @@ fi
# IPv6 initialisation?
/etc/sysconfig/network-scripts/ifup-ipv6 ${CONFIG}
if [[ "${DHCPV6C}" = [Yy1]* ]] && [ -x /sbin/dhclient ]; then
- /sbin/dhclient -6 -1 ${DHCPV6C_OPTIONS} -lf /var/lib/dhclient/dhclient6-${DEVICE}.leases -pf /var/run/dhclient6-${DEVICE}.pid -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${DEVICE}
+ generate_config_file_name 6
+ generate_lease_file_name 6
+ /sbin/dhclient -6 -1 ${DHCPV6C_OPTIONS} ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /var/run/dhclient6-${DEVICE}.pid -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${DEVICE}
fi
if [ "${IPX}" = yes ]; then