Sure, this is minor but annoying and potentially a head-bang-into-wall 
frustration for a user.  

When adding a virtual network device, ifup is hosing the routing table by 
adding two default routes if GATEWAYDEV is not specified in 
/etc/sysconfig/network.

The cause is that there's no check of the routing tables for an existing 
default gateway.

Here's my proposed solution starting on line 167 of /sbin/ifup:

-----------------------------------------------------

    . /etc/sysconfig/network
 
        DEFAULTEXISTS=` route | grep ^default`;
        if [ "${DEFAULTEXISTS}" = "" ]; then
        if [ "${GATEWAYDEV}" = "" -o "${GATEWAYDEV}" = "${DEVICE}" ]; then
                        # set up default gateway
                        if [ "${GATEWAY}" != "" ]; then
                            route add default gw ${GATEWAY} ${DEVICE}
                            DEFGW=${GATEWAY}
                        elif [ "${GATEWAYDEV}" = "${DEVICE}" ]; then
                            route add default ${DEVICE}
                        fi
        fi
        fi
fi  

-------------------------------------------------------

I'd send a proper diff, but (like a fool who doesn't bother with GATEWAYDEV) 
I didn't save the original.

Does this look workable?

-- 

Matt Steven
Web Automation
GeniusWeb.com
(605)622.7811
IM: zBluesGeek

>>=>
"I can't understand why people are frightened of new ideas. I'm frightened of 
the old ones."  -- John Cage
<=<<

Reply via email to