Re: [Dnsmasq-discuss] Is there any use case for "--dhcp-range=0.0.0.0, static, 0.0.0.0" to support all subnet

2018-03-15 Thread Simon Kelley
There's something very similar to this already in place for DHCPv6,
where it's allowed to specify

--dhcp-range=::,static

To allow any defined static allocation. For consistency, it may make
sense to simply use 0.0.0.0

so --dhcp-range=0.0.0.0,static

represents the special case. Netmask handling in that case would be have
to be automatic and hidden.

Would that make sense?


Cheers,

Simon.






On 12/03/18 08:00, Yuki Nisiwaki wrote:
> Hi dnsmasq guys.
> 
> I'm Yuki Nishiwaki.
> Recently I started to work on dnsmasq stuff. I could ask stupid thing
> though I want to ask if anyone think the same thing as me.
> 
> I'm using dnsmasq under cloud controller and dnsmasq have responsibility
> to lease IP for
> our all virtual machines connected to Host via tap on the same host
> running dnsmasq.
> 
> In order to do that, I had to specify same number of --dhcp-range as the
> number of subnet VM belong to but
> we can not add dynamically "--dhcp-range" and I don't wanna restart
> everytime new subnet added.
> 
> So I was going to specify "--dhcp-range=0.0.0.0,static,0.0.0.0"  or
> "--dhcp-range=0.0.0.0,static,128.0.0.0,
> --dhcp-range=128.0.0.0,static,128.0.0.0" to
> support all subnets possibly will be added in the future and lease IP
> for only known client.
> It kind of worked but the netmask of leased IP was the same as
> dhcp-range specified(/1). 
> I expected the netmask will be got from the NIC receiving DHCP request
> and dhcp-range's netmask is only used for judging if dnsmasq should
> reply or not.
> 
> After read the code around
> https://github.com/imp/dnsmasq/blob/master/src/dhcp.c#L501-L561, I
> understood why I can not.
> But If there is any chance I can add new option or other behaviour to
> cover my usecase
> so that dnsmasq can use the netmask of NIC's IP receiving DHCP request
> for the IP to be leased while the netmask dhcp-range specified is used
> to judge whether
> dnsmasq should reply or not, I'm willing to write the patch but
> beforehand I want to ask what do you think about such additional change.
> Is this good approach, feature or bad approach, feature nobody want but me?
> 
> 
> Regards
> 
> Yuki Nishiwaki
> 
> 
> ___
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> 


___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


[Dnsmasq-discuss] Is there any use case for "--dhcp-range=0.0.0.0, static, 0.0.0.0" to support all subnet

2018-03-12 Thread Yuki Nisiwaki
Hi dnsmasq guys.

I'm Yuki Nishiwaki.
Recently I started to work on dnsmasq stuff. I could ask stupid thing
though I want to ask if anyone think the same thing as me.

I'm using dnsmasq under cloud controller and dnsmasq have responsibility to
lease IP for
our all virtual machines connected to Host via tap on the same host running
dnsmasq.

In order to do that, I had to specify same number of --dhcp-range as the
number of subnet VM belong to but
we can not add dynamically "--dhcp-range" and I don't wanna restart
everytime new subnet added.

So I was going to specify "--dhcp-range=0.0.0.0,static,0.0.0.0"  or
"--dhcp-range=0.0.0.0,static,128.0.0.0,
--dhcp-range=128.0.0.0,static,128.0.0.0" to
support all subnets possibly will be added in the future and lease IP for
only known client.
It kind of worked but the netmask of leased IP was the same as dhcp-range
specified(/1).
I expected the netmask will be got from the NIC receiving DHCP request and
dhcp-range's netmask is only used for judging if dnsmasq should reply or
not.

After read the code around
https://github.com/imp/dnsmasq/blob/master/src/dhcp.c#L501-L561, I
understood why I can not.
But If there is any chance I can add new option or other behaviour to cover
my usecase
so that dnsmasq can use the netmask of NIC's IP receiving DHCP request for
the IP to be leased while the netmask dhcp-range specified is used to judge
whether
dnsmasq should reply or not, I'm willing to write the patch but
beforehand I want to ask what do you think about such additional change. Is
this good approach, feature or bad approach, feature nobody want but me?


Regards

Yuki Nishiwaki
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss