dhcpd on 5.8/AMD64 - default-lease-time and max-lease-time ignored

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

dhcpd on 5.8/AMD64 - default-lease-time and max-lease-time ignored

Arne
>Synopsis: default-lease-time and max-lease-time ignored in dhcpd.conf
>Category: system
>Environment:
        System      : OpenBSD 5.8
        Details     : OpenBSD 5.8-current (GENERIC) #1608: Wed Dec 9 11:26:40 MST 2015
                        [hidden email]:/usr/src/sys/arch/amd64/compile/GENERIC

        Architecture: OpenBSD.amd64
        Machine     : amd64
>Description:

After setting up dhcpd on 5.8/AMD64 I noticed that the default-lease-time
and max-lease-time in leases are always set to the default 43200 and
86400, regardless of the settings in dhcpd.conf. Parsing problem?

Same dhcpd.conf on 5.7 works as expected. This problem still exists in
-current, see above.

Arne

Reply | Threaded
Open this post in threaded view
|

Re: dhcpd on 5.8/AMD64 - default-lease-time and max-lease-time ignored

Serguey Parkhomovsky
Forgot to CC the list...

On Thu, Dec 10, 2015 at 11:39:57PM +0100, Arne wrote:
> After setting up dhcpd on 5.8/AMD64 I noticed that the default-lease-time
> and max-lease-time in leases are always set to the default 43200 and
> 86400, regardless of the settings in dhcpd.conf. Parsing problem?
>
> Same dhcpd.conf on 5.7 works as expected. This problem still exists in
> -current, see above.
>
> Arne
>

Hi Arne,

Does the following patch fix your issue? Looks like rev 1.18 removed the
line that set the time after parsing.

Index: parse.c
===================================================================
RCS file: /cvs/src/usr.sbin/dhcpd/parse.c,v
retrieving revision 1.18
diff -u -p -r1.18 parse.c
--- parse.c 18 May 2015 17:51:21 -0000 1.18
+++ parse.c 11 Dec 2015 04:41:03 -0000
@@ -268,6 +268,8 @@ parse_lease_time(FILE *cfile, time_t *ti
  return;
  }
 
+ *timep = value;
+
  parse_semi(cfile);
 }
 

Reply | Threaded
Open this post in threaded view
|

Re: dhcpd on 5.8/AMD64 - default-lease-time and max-lease-time ignored

Arne
On Thu, 10 Dec 2015, Serguey Parkhomovsky wrote:

> Forgot to CC the list...
>
> On Thu, Dec 10, 2015 at 11:39:57PM +0100, Arne wrote:
> > After setting up dhcpd on 5.8/AMD64 I noticed that the default-lease-time
> > and max-lease-time in leases are always set to the default 43200 and
> > 86400, regardless of the settings in dhcpd.conf. Parsing problem?
> >
> > Same dhcpd.conf on 5.7 works as expected. This problem still exists in
> > -current, see above.
> >
> > Arne
> >
>
> Hi Arne,
>
> Does the following patch fix your issue? Looks like rev 1.18 removed the
> line that set the time after parsing.
>
> Index: parse.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/dhcpd/parse.c,v
> retrieving revision 1.18
> diff -u -p -r1.18 parse.c
> --- parse.c 18 May 2015 17:51:21 -0000 1.18
> +++ parse.c 11 Dec 2015 04:41:03 -0000
> @@ -268,6 +268,8 @@ parse_lease_time(FILE *cfile, time_t *ti
>   return;
>   }
>
> + *timep = value;
> +
>   parse_semi(cfile);
>  }

Ken already sent me the same diff ;) Anyway it does indeed fix the
default-lease-time issue.

Arne