<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.28.0">
</HEAD>
<BODY>
Hi All<BR>
<BR>
I'm using dnsmasq version 2.47 <FONT COLOR="#000000">on Ubuntu Server Jaunty </FONT>with a custom dhcp-script and the option leasefile-ro.<FONT COLOR="#000000"> </FONT>The script is a PHP file which stores the lease database together with available DHCP options (vendorid and so on) in a PostgreSQL database.<BR>
After a restart of dnsmasq, when the script is called with init, i read the active leases and print them with the following statement:<BR>
<BR>
fputs(STDOUT, <FONT COLOR="#000000">&quot;</FONT>$lease<FONT COLOR="#000000">&quot;</FONT>);<BR>
<BR>
where $lease = '1255470657 00:1f:29:b4:84:82 192.168.0.194 pisces *'. Observe that this is without any added \n.<BR>
<BR>
I also log this to a log file, that after init contains the following:<BR>
<BR>
2009-10-13 23:23:18 - init: 1255470657 00:1f:29:b4:84:82 192.168.0.194 pisces *<BR>
2009-10-13 23:23:18 - init: 1255470430 00:01:38:99:52:80 192.168.0.182 betelgeuse 01:00:01:38:99:52:80<BR>
2009-10-13 23:23:18 - init: 1255470317 00:21:00:d2:25:4e 192.168.0.113 Delphinus 01:00:21:00:d2:25:4e<BR>
2009-10-13 23:23:18 - init: 1255470271 08:00:27:23:dd:64 192.168.0.104 caelum 01:08:00:27:23:dd:64<BR>
2009-10-13 23:23:18 - init: 1255470066 00:02:61:0f:c2:ec 192.168.0.123 * 01:00:02:61:0f:c2:ec<BR>
<BR>
In the syslog, the following rows has appeared:<BR>
<BR>
Oct 13 23:23:17 aurora dnsmasq[5420]: exiting on receipt of SIGTERM<BR>
Oct 13 23:23:18 aurora dnsmasq[5611]: started, version 2.47 cachesize 150<BR>
Oct 13 23:23:18 aurora dnsmasq[5611]: compile time options: IPv6 GNU-getopt DBus I18N TFTP<BR>
Oct 13 23:23:18 aurora dnsmasq[5611]: DHCP, IP range 192.168.0.101 -- 192.168.0.199, lease time 30m<BR>
Oct 13 23:23:18 aurora dnsmasq[5611]: reading /etc/resolv.conf<BR>
Oct 13 23:23:18 aurora dnsmasq[5611]: using nameserver 195.54.122.200#53<BR>
Oct 13 23:23:18 aurora dnsmasq[5611]: using nameserver 195.54.122.198#53<BR>
Oct 13 23:23:18 aurora dnsmasq[5611]: read /etc/hosts - 21 addresses<BR>
<BR>
The problem I'm having with this setup is that when the host pisces, which is a Ubuntu Karmic host, request it's next IP, the event generated is not an 'Old' but an 'Add'.<FONT COLOR="#000000"> This is the row that appears in my dhcp log file:</FONT><BR>
<BR>
<FONT COLOR="#000000">2009-10-13 23:23:45 - add: 00:1f:29:b4:84:82 192.168.0.194 pisces&nbsp; eth1 1800&nbsp; brander.local</FONT><BR>
<BR>
Is that correct? The client first does two DHCPREQUEST, which dnsmasq <FONT COLOR="#000000">host </FONT>responds with DHCPNAK. Then the client does a DHCPDISCOVER and gets an IP - some times the same IP, some times a different IP. Is this a feature or a bug?<BR>
<BR>
Since dnsmasq read the lease file during init, it should give out the <FONT COLOR="#000000">same</FONT> address and generate an 'Old' event. Or am I just stupid?<BR>
<BR>
<FONT COLOR="#000000">Can anyone help me?</FONT><BR>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<BR>
<B><FONT COLOR="#000000">Best Regards, Tommy Brander</FONT></B><BR>
<FONT COLOR="#1f497d"><A HREF="mailto:tommy@brander.nu">tommy@brander.nu</A>&nbsp; &#8226; <A HREF="http://www.brander.nu">www.brander.nu</A></FONT><BR>
<BR>
<I><FONT COLOR="#426a3e">Viam inveniam aut faciam - I shall either find a way or make one</FONT></I> 
</TD>
</TR>
</TABLE>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<BR>
<B><FONT COLOR="#000000">Best Regards, Tommy Brander</FONT></B><BR>
<FONT COLOR="#1f497d"><A HREF="mailto:tommy@brander.nu">tommy@brander.nu</A>&nbsp; &#8226; <A HREF="http://www.brander.nu">www.brander.nu</A></FONT><BR>
<BR>
<I><FONT COLOR="#426a3e">Viam inveniam aut faciam - I shall either find a way or make one</FONT></I> <BR>
<BR>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>