Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 1318

Summary: net scripts don't properly release dhcp lease on interface shutdown
Product: Gentoo Linux Reporter: Jim Nutt <jim>
Component: [OLD] Core systemAssignee: Daniel Robbins (RETIRED) <drobbins>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 1319    

Description Jim Nutt 2002-03-23 10:50:53 UTC
When a network interface controlled by dhcp is shutdown, the dhcp lease is not
being released and dhcpcd is not being killed. This causes problems with pcmcia
and hotplug interfaces as they are not completely shutdown on eject.
Comment 1 Jim Nutt 2002-03-23 11:02:17 UTC
Can't seem to attach the file with the updated /etc/init.d/net.eth0. Here is the
pertinent section:

        /sbin/ifconfig ${IFACE} down &>/dev/null
        if [ "$(eval echo \$\{iface_${IFACE}\})" == "dhcp" ]
        then
                /sbin/dhcpcd -k ${IFACE} &>/dev/null 
        fi
        eend 0

It goes after the alias shutdown code in the stop() section.
Comment 2 Daniel Robbins (RETIRED) gentoo-dev 2002-03-23 12:11:46 UTC
It looks like this fix is (sorta) already on our internal CVS.  The only 
difference is that our version doesn't using ifconfig to bring the interface 
down if it's dhcp (the first line in your script snippet is not executed).  Is 
this correct or does the ifconfig line need to execute either way?
Comment 3 Jim Nutt 2002-03-23 12:14:53 UTC
ifconfig down does need to be execute in both cases. If you don't do it before
the dhcpcd -k, the dhcpcd -k fails..

Comment 4 Daniel Robbins (RETIRED) gentoo-dev 2002-03-23 12:35:10 UTC
Fixed in baselayout-1.7.5.  Thanks! :)