[pve-devel] [PATCH dnsmasq 0/1] purge previous ip/mac lease of dhcp reply

DERUMIER, Alexandre alexandre.derumier at groupe-cyllene.com
Fri Nov 17 11:46:12 CET 2023


> > If all you need is the `lease_prune()` call from your C patch,
> > dnsmasq
> > also does this on a SIGALRM so you could try to see if sending that
> > helps.
> > 
> > (dnsmasq also has a dbus api to add/remove leases for the worst
> > case...)

> > ah ok ! didn't known that, I'll try the SIGALRM && dbus to see.
> > Thanks
> > !

>>SIGALRM don't seem to work, 
>>

>>but looking at dbus doc, that seem really even better
>>https://github.com/imp/dnsmasq/blob/master/dbus/DBus-interface
>>
>>we could directly manage leases, without need to manage the ether
>>file
>>and without reload.


Ok, it's working with dbus to update the lease (and etherfile still
needed)

ex:


use Net::DBus;

my $bus = Net::DBus->system();
my $dnsmasq = $bus->get_service("uk.org.thekelleys.dnsmasq");
my $manager = $dnsmasq-
>get_object("/uk/org/thekelleys/dnsmasq","uk.org.thekelleys.dnsmasq");

my @hostname = unpack("C*", "vmhostname");
$manager->AddDhcpLease('192.168.2.10','12:45:6D:33:3C:E8', \@hostname,
undef, 0, 0, 0);




The problem is that dbus is only working with 1 instance of dnsmasq. :/

That mean it'll not work if we need mulitple instance, in differents
zones/vrf for example


More information about the pve-devel mailing list