Commit 797a7afb authored by Giacomo Tazzari's avatar Giacomo Tazzari Committed by Simon Kelley

Fix crash on SERVFAIL when --conntrack in use.

parent 4b5ea12e
version 2.67
Fix crash if upstream server returns SERVFAIL when
--conntrack in use. Thanks to Giacomo Tazzari for finding
this and supplying the patch.
version 2.66 version 2.66
Add the ability to act as an authoritative DNS Add the ability to act as an authoritative DNS
server. Dnsmasq can now answer queries from the wider 'net server. Dnsmasq can now answer queries from the wider 'net
......
...@@ -328,8 +328,8 @@ static int forward_query(int udpfd, union mysockaddr *udpaddr, ...@@ -328,8 +328,8 @@ static int forward_query(int udpfd, union mysockaddr *udpaddr,
struct server *firstsentto = start; struct server *firstsentto = start;
int forwarded = 0; int forwarded = 0;
if (udpaddr && option_bool(OPT_ADD_MAC)) if (option_bool(OPT_ADD_MAC))
plen = add_mac(header, plen, ((char *) header) + PACKETSZ, udpaddr); plen = add_mac(header, plen, ((char *) header) + PACKETSZ, &forward->source);
while (1) while (1)
{ {
...@@ -372,7 +372,7 @@ static int forward_query(int udpfd, union mysockaddr *udpaddr, ...@@ -372,7 +372,7 @@ static int forward_query(int udpfd, union mysockaddr *udpaddr,
if (option_bool(OPT_CONNTRACK)) if (option_bool(OPT_CONNTRACK))
{ {
unsigned int mark; unsigned int mark;
if (get_incoming_mark(udpaddr, dst_addr, 0, &mark)) if (get_incoming_mark(&forward->source, &forward->dest, 0, &mark))
setsockopt(fd, SOL_SOCKET, SO_MARK, &mark, sizeof(unsigned int)); setsockopt(fd, SOL_SOCKET, SO_MARK, &mark, sizeof(unsigned int));
} }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment