Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 152190 - DHCP IP address renewing may force unnecessary gateways deletes/adds
Summary: DHCP IP address renewing may force unnecessary gateways deletes/adds
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-20 22:58 UTC by Adam Nielsen
Modified: 2006-10-21 05:11 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Nielsen 2006-10-20 22:58:02 UTC
I've just discovered that when dhclient (and probably udhcpc) renews the IP address for a NIC (i.e. the IP doesn't actually change) the scripts still remove and re-add the default gateway.

This has the unfortunate side effect of terminating some connections while the gateway is momentarily removed.  Unfortunately my DSL modem insists on setting the DHCP lease to 60 seconds, so every 60 seconds I was getting a tiny interruption in my Internet connectivity.  It was enough to cause an 'emerge --sync' to abrubtly stop and then timeout (so apologies to the AU mirror, I tried unsuccessfully to sync about 15 times this morning until I discovered the problem.  The data flew through at my modem's full speed, then about 60 seconds into the transfer it just stopped, and three minutes later timed out.)

Given that a 'renew' operation is flagged separately, this problem can be fixed by editing /lib/rcscripts/net.modules.d/helpers.d/udhcpc-ifconfig and under the line that says "[[ ${action} == nak ]] && exit 0" add this line:

[[ ${action} == renew ]] && exit 0

This will cause the script to do nothing when the IP address has been renewed (as there is nothing that needs to be done, a renew means the configuration will be staying the same for a little longer.)

This has fixed the problem at my end, now I can make it all the way through the emerge operation without any problems.
Comment 1 Roy Marples (RETIRED) gentoo-dev 2006-10-21 05:11:03 UTC
We let the dhcp daemons use their own scripts these days, starting with baselayout-1.12. udhcpc will probably have this issue as it's init script is based off that, but I think that dhclient is fine for it as it's mostly upstreams script.