LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware 12.1: rc.inet1, dhcpcd and infinite lease times (bug?) (http://www.linuxquestions.org/questions/slackware-14/slackware-12-1-rc-inet1-dhcpcd-and-infinite-lease-times-bug-663822/)

El Nigromante 08-19-2008 08:46 AM

Slackware 12.1: rc.inet1, dhcpcd and infinite lease times (bug?)
 
Hello,

Testing my recent Slackware 12.1 installation I have found this problem:

I connect my PC via ethernet cable to an ADSL router, which provides NAT and DHCP. The router's internal DHCP server was configured with an infinite lease time.

With this setup my Slackware PC system starts ok, gets DHCP configuration from router, and configures network interface. If the connection/cable is permanent everything works fine.

However, when I try to invoke directly the /etc/rc.d/rc.inet1 script with stop / start arguments in sequence, I notice that something is broken, as interface eth0 does not get down after "stop". This causes additional problems if you try to start the interface again: the script seems to believe it is already started and does nothing.

I have investigated /etc/rc.d/rc.inet1 script and it only brings down directly lo interface. In order to bring down my eth0, it calls dhcpcd client with appropriate parameters so that program becomes responsible for bringing eth0 down. That is, /etc/rc.d/rc.inet1 expects dhcpcd to be running.

Investigating a bit further I have realized that dhcpcd (supposed to run as daemon), is no longer running after system start. I have parsed /var/log/messages and found the following:

Code:

dhcpcd[2960]: infinite IP address lease time. Exiting
So it seems that if the DHCP server provides an infinite lease time, it causes to break Slackware's interface management infraestructure.

I have changed the lease time in my router, and the problem has disappeared. Nevertheless, should this behaviour be considered a bug (and may be fixed) in Slackware?

Thanks,

trickykid 08-21-2008 10:20 AM

This isn't really a bug per se, as dhcpcd follows the RFC2131 which states this:

Quote:

The client may ask for a permanent assignment by asking for an infinite lease. Even when assigning "permanent" addresses, a server may choose to give out lengthy but non-infinite leases to allow detection of the fact that the client has been retired.
In most cases, most routers will never give out an infinite lease time, that's just kind of stupid and takes away the purpose of using DHCP. If you want a server to have the same IP at all times, it's better to just set it up with a static IP.

So from my understanding, it's not really a bug in Slackware nor dhcpcd, most routers don't provide infinite DHCP addresses.

Here's the full RFC2131: http://www.faqs.org/rfcs/rfc2131.html


All times are GMT -5. The time now is 04:05 AM.