aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2001-04-02 21:14:41 +0000
committerBill Nottingham <notting@redhat.com>2001-04-02 21:14:41 +0000
commit749a7f8b44dcb2bda9d5aebb1dafabfa9f9a8c25 (patch)
tree0f6c712453aa371b834c0bd1fac0faf4bbbd02f9
parent7e190b9b89ed92875e47fe98f85280fec70aa03d (diff)
downloadinitscripts-749a7f8b44dcb2bda9d5aebb1dafabfa9f9a8c25.tar
initscripts-749a7f8b44dcb2bda9d5aebb1dafabfa9f9a8c25.tar.gz
initscripts-749a7f8b44dcb2bda9d5aebb1dafabfa9f9a8c25.tar.bz2
initscripts-749a7f8b44dcb2bda9d5aebb1dafabfa9f9a8c25.tar.xz
initscripts-749a7f8b44dcb2bda9d5aebb1dafabfa9f9a8c25.zip
fix typo (#31627)
get rid of error message if ${GATEWAY} isn't set fix typos (DHCPDARGS vs. DHCPCDARGS) (#26378) remove old broken code allow devices without an IP address (#24127) don't try and run pump if it's not there honor PEERDNS=no for pump and dhcpcd too (#18619) fix ARP handling, allow for setting promiscuous or all-multicast mode fix more ifconfig greps (patch from Conectiva)
-rwxr-xr-xsysconfig/network-scripts/ifup32
1 files changed, 21 insertions, 11 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index 6f7db977..a8efb393 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -66,7 +66,7 @@ if [ -x ${OTHERSCRIPT} ]; then
fi
# is this device available? (this catches PCMCIA devices for us)
-/sbin/ifconfig ${REALDEVICE} 2>&1 | grep -s "not found" > /dev/null
+LC_ALL= LANG= /sbin/ifconfig ${REALDEVICE} 2>&1 | grep -s "not found" > /dev/null
if [ "$?" = "0" ]; then
echo "Delaying ${DEVICE} initialization."
exit 1
@@ -98,16 +98,27 @@ if [ -n "${DYNCONFIG}" ]; then
PUMPARGS="${PUMPARGS} --lookup-hostname"
DHCPCDARGS="${DHCPCDARGS} -H"
fi
+ if [ "${PEERDNS}" = "no" ]; then
+ PUMPARGS="${PUMPARGS} -d"
+ DHCPCDARGS="${DHCPCDARGS} -R"
+ fi
echo -n "Determining IP information for ${DEVICE}..."
- if /sbin/pump ${PUMPARGS} -i ${DEVICE} ; then
+
+ if [ -x /sbin/pump ] && /sbin/pump ${PUMPARGS} -i ${DEVICE} ; then
echo " done."
- elif /sbin/dhcpcd ${DHCPCDARGS} ${DEVICE} ; then
+ elif [ -x /sbin/dhcpcd ] && /sbin/dhcpcd ${DHCPCDARGS} ${DEVICE} ; then
echo " done."
else
echo " failed."
exit 1
fi
else
+ if [ -z "${IPADDR}" ]; then
+ # enable device without IP, useful for e.g. PPPoE
+ ifconfig ${DEVICE} up ${MTU:+mtu $MTU}
+ exec /etc/sysconfig/network-scripts/ifup-post ${CONFIG} ${2}
+ fi
+
if [ -z "${NETMASK}" ]; then
eval `/bin/ipcalc --netmask ${IPADDR}`
fi
@@ -120,7 +131,11 @@ else
eval `/bin/ipcalc --network ${IPADDR} ${NETMASK}`
fi
- ifconfig ${DEVICE} ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST} ${ARP:+arp} ${MTU:+mtu $MTU}
+ ifconfig ${DEVICE} ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST} \
+ $(toggle_value arp $ARP) \
+ $(toggle_value promisc $PROMISC) \
+ $(toggle_value allmulti $ALLMULTI)
+
# don't re-add subnet route on 2.2 kernels, but add a route
# to a non-local subnet.
# stupid hack, but it should work
@@ -128,16 +143,11 @@ else
route add -net ${NETWORK} netmask ${NETMASK} dev ${DEVICE}
fi
- # this is broken! it's only here for compatibility with old RH systems
- if [ "${GATEWAY}" != "" -a "${GATEWAY}" != "none" ]; then
- route add default gw ${GATEWAY} metric 1 ${DEVICE}
- fi
-
. /etc/sysconfig/network
- if [ "${GATEWAYDEV}" = "" -o "${GATEWAYDEV}" = "${DEVICE}" ]; then
+ if [ -z "${GATEWAYDEV}" -o "${GATEWAYDEV}" = "${DEVICE}" ]; then
# set up default gateway
- if [ "${GATEWAY}" != "" ]; then
+ if [ -n "${GATEWAY}" -a "`ipcalc --network ${GATEWAY} ${NETMASK} 2>/dev/null`" = "NETWORK=${NETWORK}" ]; then
route add default gw ${GATEWAY} ${DEVICE}
DEFGW=${GATEWAY}
elif [ "${GATEWAYDEV}" = "${DEVICE}" ]; then