Hi all; now that I've been thinking about my dnsmasq implementation again I have a question. I alluded to it in passing in my previous thread but I wanted to bring it out for some advice.
On my system I have a lot of embedded (running from ramdisk) blades. They do not have a DHCP client daemon, so they never send RENEW packets. And, they live a long time (hopefully!) between reboots. Suppose I had run out of available leases and, because no RENEW requests are being sent, all my leases had been marked as expired even though they're still used. Now if a new MAC does a DHCPDISCOVER, would dnsmasq simply hand out the first expired lease it finds, or does it look through expired leases to determine if they're still active (via ping I suppose) and try to hand out an unused lease, regardless of RENEW? I see in the RFC that a ping is a SHOULD requirement... does dnsmasq implement this? How does dnsmasq choose between expired leases? Is it random? Or is the list ordered on when that MAC was last heard from, for example? Seems unlikely but I thought I'd ask. Currently I've been assuming that because I didn't RENEW, my lease might be taken, and so to counteract that I've been setting my lease time to "infinite". But, I foresee problems here, too. If I have infinite lease timeouts and I run out of leases, will they ever be reassigned? It seems like in this case I just get an error saying that I'm out of leases and no new leases can be assigned; in this case I'd need to have some way of cleaning out the leases database of "old" stuff... but that's not so easy (especially in light of the MAC hashing problem we've been discussing, which makes simply deleting the leases database problematic). Anyone have any thoughts about a "best practice" implementation of this sort of thing? I'd really like to find something that "just works", even if lots of blades are replaced eventually, causing cruft buildup in the leases database, which might eventually cause me to reach the maximum leases assignable.
