From f68092f16f891b6590bea27cac9313387cd8f1a2 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 7 Jun 2004 19:40:40 +0000 Subject: remove bogus route setting (#120908) --- sysconfig/network-scripts/ifup-aliases | 36 ++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/sysconfig/network-scripts/ifup-aliases b/sysconfig/network-scripts/ifup-aliases index 40d27f7d..277fd6f0 100755 --- a/sysconfig/network-scripts/ifup-aliases +++ b/sysconfig/network-scripts/ifup-aliases @@ -255,11 +255,6 @@ function new_interface () if [ "$NO_ALIASROUTING" != yes ]; then - # 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 - GATEWAY=$network_GATEWAY; GATEWAYDEV=$network_GATEWAYDEV; @@ -291,11 +286,38 @@ function new_interface () if [ "$BASH_VERSINFO" ]; then shopt -s nullglob; else allow_null_glob_expansion=foo; fi +# Is there any linuxconf-style alias files. +linuxconfstyle=0 for FILE in ifcfg-${parent_device}:* ; do + ini_env; . $FILE; - new_interface; + if [ -z "$DEVICE" ]; then + # it's a linuxconf file. + # I don't think this script will handle both style correctly + # though. Well, those who knows about the other style don't know + # the other style and vice versa + linuxconfstyle=1 + else + new_interface; + fi done +if [ "$linuxconfstyle" = "1" ] ; then + linuxconf --hint ipalias $device \ + | while read command ali ip mask bcast + do + if [ "$command" = "del" ] ; then + /sbin/ifconfig $ali down + do_netreport=yes + elif [ "$command" = "add" ] ; then + /sbin/ifconfig $ali $ip netmask $mask broadcast $bcast + do_netreport=yes + else + echo Incomatible hinting: $command $rest >&2 + fi + done +fi + for FILE in ifcfg-${parent_device}-range* ; do @@ -330,6 +352,7 @@ done # # Remove any devices that should not be around # +if [ "$linuxconfstyle" = "0" ] ; then for DEVNUM in $rdev_LIST ; do eval " rdev_mark=\$rdev_${DEVNUM}_mark "; if [ -z "$rdev_mark" ]; then @@ -338,6 +361,7 @@ done do_netreport=yes fi done +fi # # Notify of new device creation # -- cgit v1.2.1