Hi,

Observing that dnsmasq (version 2.80) is offering DHCP IP to the client
from a vlan pool which is in DOWN state.

E.g. If there are 3 dhcp pools

vlan9 (State UP) : Range: 192.168.9.1-192.168.9.254

vlan19 (State UP): Range: 192.168.19.1-192.168.19.254

vlan99 (State DOWN): Range: 192.168.99.1-192.168.99.254



1) Client on vlan9 gets IP from vlan9 pool

2) Client moves to vlan19, releases IP

3) Client on vlan19 requests IP --> dnsmasq offers IP 192.168.99.xx from
vlan99 pool (incorrect pool), instead of vlan19 pool.



If the vlan99 is in UP state, then dnsmasq offers the IP from the vlan19
pool (the correct pool).



If dnsmasq is rebuilt by commenting out the following code block from
dhcp_reply function, then in the above case, dnsmasq offers IP from the
vlan19 pool (the correct pool) even if vlan99 is DOWN.

code block -->

/* guess the netmask for relayed networks */

            if (!(context_tmp->flags & CONTEXT_NETMASK) &&
context_tmp->netmask.s_addr == 0)

              {

                if (IN_CLASSA(ntohl(context_tmp->start.s_addr)) &&
IN_CLASSA(ntohl(context_tmp->end.s_addr)))

                  netmask.s_addr = htonl(0xff000000);

                else if (IN_CLASSB(ntohl(context_tmp->start.s_addr)) &&
IN_CLASSB(ntohl(context_tmp->end.s_addr)))

                  netmask.s_addr = htonl(0xffff0000);

                else if (IN_CLASSC(ntohl(context_tmp->start.s_addr)) &&
IN_CLASSC(ntohl(context_tmp->end.s_addr)))

                  netmask.s_addr = htonl(0xffffff00);

              }



Has anyone come across such an issue?



Thanks,

Shashi
_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss

Reply via email to