mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Fix endian bug in --local-service code.
This commit is contained in:
committed by
Simon Kelley
parent
00c0f69aa5
commit
15b1b7e9c3
@@ -49,6 +49,9 @@ version 2.71
|
|||||||
regression introduced in 2.69. Thanks to James Hunt and
|
regression introduced in 2.69. Thanks to James Hunt and
|
||||||
the Ubuntu crowd for assistance in fixing this.
|
the Ubuntu crowd for assistance in fixing this.
|
||||||
|
|
||||||
|
Fix problem with --local-service option on big-endian platforms
|
||||||
|
Thanks to Richard Genoud for the patch.
|
||||||
|
|
||||||
|
|
||||||
version 2.70
|
version 2.70
|
||||||
Fix crash, introduced in 2.69, on TCP request when dnsmasq
|
Fix crash, introduced in 2.69, on TCP request when dnsmasq
|
||||||
|
|||||||
@@ -1118,7 +1118,7 @@ void receive_query(struct listener *listen, time_t now)
|
|||||||
struct in_addr netmask;
|
struct in_addr netmask;
|
||||||
for (addr = daemon->interface_addrs; addr; addr = addr->next)
|
for (addr = daemon->interface_addrs; addr; addr = addr->next)
|
||||||
{
|
{
|
||||||
netmask.s_addr = 0xffffffff << (32 - addr->prefixlen);
|
netmask.s_addr = htonl(~(in_addr_t)0 << (32 - addr->prefixlen));
|
||||||
if (!(addr->flags & ADDRLIST_IPV6) &&
|
if (!(addr->flags & ADDRLIST_IPV6) &&
|
||||||
is_same_net(addr->addr.addr.addr4, source_addr.in.sin_addr, netmask))
|
is_same_net(addr->addr.addr.addr4, source_addr.in.sin_addr, netmask))
|
||||||
break;
|
break;
|
||||||
@@ -1652,7 +1652,7 @@ unsigned char *tcp_request(int confd, time_t now,
|
|||||||
struct in_addr netmask;
|
struct in_addr netmask;
|
||||||
for (addr = daemon->interface_addrs; addr; addr = addr->next)
|
for (addr = daemon->interface_addrs; addr; addr = addr->next)
|
||||||
{
|
{
|
||||||
netmask.s_addr = 0xffffffff << (32 - addr->prefixlen);
|
netmask.s_addr = htonl(~(in_addr_t)0 << (32 - addr->prefixlen));
|
||||||
if (!(addr->flags & ADDRLIST_IPV6) &&
|
if (!(addr->flags & ADDRLIST_IPV6) &&
|
||||||
is_same_net(addr->addr.addr.addr4, peer_addr.in.sin_addr, netmask))
|
is_same_net(addr->addr.addr.addr4, peer_addr.in.sin_addr, netmask))
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user