|
|
cab8d5 |
From 797a7afba477390bc016c647cfb792c85ee6102d Mon Sep 17 00:00:00 2001
|
|
|
cab8d5 |
From: Giacomo Tazzari <giacomo.tazzari@gmail.com>
|
|
|
cab8d5 |
Date: Mon, 22 Apr 2013 13:16:37 +0100
|
|
|
cab8d5 |
Subject: [PATCH] Fix crash on SERVFAIL when --conntrack in use.
|
|
|
cab8d5 |
|
|
|
cab8d5 |
---
|
|
|
cab8d5 |
CHANGELOG | 5 ++++++
|
|
|
cab8d5 |
src/forward.c | 6 +++---
|
|
|
cab8d5 |
2 files changed, 9 insertions(+), 3 deletions(-)
|
|
|
cab8d5 |
|
|
|
cab8d5 |
diff --git a/CHANGELOG b/CHANGELOG
|
|
|
cab8d5 |
index 93aaf18..6cb1b51 100644
|
|
|
cab8d5 |
--- a/CHANGELOG
|
|
|
cab8d5 |
+++ b/CHANGELOG
|
|
|
cab8d5 |
@@ -1,3 +1,8 @@
|
|
|
cab8d5 |
+ Fix crash if upstream server returns SERVFAIL when
|
|
|
cab8d5 |
+ --conntrack in use. Thanks to Giacomo Tazzari for finding
|
|
|
cab8d5 |
+ this and supplying the patch.
|
|
|
cab8d5 |
+
|
|
|
cab8d5 |
+
|
|
|
cab8d5 |
version 2.66
|
|
|
cab8d5 |
Add the ability to act as an authoritative DNS
|
|
|
cab8d5 |
server. Dnsmasq can now answer queries from the wider 'net
|
|
|
cab8d5 |
diff --git a/src/forward.c b/src/forward.c
|
|
|
cab8d5 |
index 77d6849..78495ca 100644
|
|
|
cab8d5 |
--- a/src/forward.c
|
|
|
cab8d5 |
+++ b/src/forward.c
|
|
|
cab8d5 |
@@ -328,8 +328,8 @@ static int forward_query(int udpfd, union mysockaddr *udpaddr,
|
|
|
cab8d5 |
struct server *firstsentto = start;
|
|
|
cab8d5 |
int forwarded = 0;
|
|
|
cab8d5 |
|
|
|
cab8d5 |
- if (udpaddr && option_bool(OPT_ADD_MAC))
|
|
|
cab8d5 |
- plen = add_mac(header, plen, ((char *) header) + PACKETSZ, udpaddr);
|
|
|
cab8d5 |
+ if (option_bool(OPT_ADD_MAC))
|
|
|
cab8d5 |
+ plen = add_mac(header, plen, ((char *) header) + PACKETSZ, &forward->source);
|
|
|
cab8d5 |
|
|
|
cab8d5 |
while (1)
|
|
|
cab8d5 |
{
|
|
|
cab8d5 |
@@ -372,7 +372,7 @@ static int forward_query(int udpfd, union mysockaddr *udpaddr,
|
|
|
cab8d5 |
if (option_bool(OPT_CONNTRACK))
|
|
|
cab8d5 |
{
|
|
|
cab8d5 |
unsigned int mark;
|
|
|
cab8d5 |
- if (get_incoming_mark(udpaddr, dst_addr, 0, &mark))
|
|
|
cab8d5 |
+ if (get_incoming_mark(&forward->source, &forward->dest, 0, &mark))
|
|
|
cab8d5 |
setsockopt(fd, SOL_SOCKET, SO_MARK, &mark, sizeof(unsigned int));
|
|
|
cab8d5 |
}
|
|
|
cab8d5 |
#endif
|
|
|
cab8d5 |
--
|
|
|
cab8d5 |
1.8.1.4
|
|
|
cab8d5 |
|