Project

General

Profile

Actions

Bug #436

closed

[PATCH] rewrite of tinydns_add_active_leases

Added by znerol znerol about 15 years ago. Updated almost 13 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
DNS Server
Target version:
-
Start date:
03/19/2010
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Affected Version:
Affected Plus Version:
Affected Architecture:

Description

This is a rewrite of the function tinydns_add_active_leases. It now handles multiple entries for one ip in the dhcpd.leases file properly and also creates host records with a timestamp matching the end-of-lease in order to allow tinydns-data to automatically adjust the ttl of the record.

We no host entry in this situation (lease given up by client):

lease 192.168.1.199 {
  starts 5 2010/03/19 16:25:26;
  ends 5 2010/03/19 18:25:26;
  binding state active;
  next binding state free;
  hardware ethernet a2:81:6e:47:79:90;
  client-hostname "testhost";
}
lease 192.168.1.199 {
  starts 5 2010/03/19 16:25:26;
  ends 5 2010/03/19 16:28:06;
  tstp 5 2010/03/19 16:28:06;
  binding state free;
  hardware ethernet a2:81:6e:47:79:90;
}

We get a proper host-entry for this situation:

lease 192.168.1.199 {
  starts 5 2010/03/19 16:28:25;
  ends 5 2010/03/19 18:28:25;
  binding state active;
  next binding state free;
  hardware ethernet a2:81:6e:47:79:90;
  client-hostname "testhost";
}

=testhost.local:192.168.1.199:0:400000004ba3c253

Files

Actions #1

Updated by Chris Buechler almost 15 years ago

  • Category set to DNS Server
Actions #2

Updated by Chris Buechler almost 15 years ago

  • Status changed from New to Feedback

This has been applied and committed, thanks! Can you please confirm with package version 1.0.6.8 that this is functioning correctly?

Actions #3

Updated by znerol znerol almost 15 years ago

Tested with package version 1.0.6.11 and pfSense-2.0-BETA4-20100804-1929.iso. Looks okay to me so far.

A little hint for testing/debugging dhcp-related issues with pfsense running on a virtual machine on some dev-box. Setup a bridge interface on your dev-box (Linux: brctl addbr testbr1, FreeBSD/OSX: ifconfig bridge create [not so sure about that]), attach the LAN interface of the pfsense vm to that bridge and run dhclient against it with an empty dhclient-script in order to prevent your network setup from getting messed up.

dhclient -d -lf /tmp/dhclient.leases -pf /tmp/dhclient.pid -cf /tmp/dhclient.conf -sf /tmp/dhclient-script testbr1
Actions #4

Updated by Jim Pingle almost 13 years ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF