aboutgitcodebugslistschat
path: root/fwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'fwd.c')
-rw-r--r--fwd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fwd.c b/fwd.c
index 48764c5..add01c0 100644
--- a/fwd.c
+++ b/fwd.c
@@ -976,10 +976,12 @@ uint8_t fwd_nat_from_tap(const struct ctx *c, uint8_t proto,
const struct flowside *ini, struct flowside *tgt)
{
if (is_dns_flow(proto, ini) &&
- inany_equals4(&ini->oaddr, &c->ip4.dns_match))
+ inany_equals4(&ini->oaddr, &c->ip4.dns_match) &&
+ !IN4_IS_ADDR_UNSPECIFIED(&c->ip4.dns_host))
tgt->eaddr = inany_from_v4(c->ip4.dns_host);
else if (is_dns_flow(proto, ini) &&
- inany_equals6(&ini->oaddr, &c->ip6.dns_match))
+ inany_equals6(&ini->oaddr, &c->ip6.dns_match) &&
+ !IN6_IS_ADDR_UNSPECIFIED(&c->ip6.dns_host))
tgt->eaddr.a6 = c->ip6.dns_host;
else
nat_outbound(c, &ini->oaddr, &tgt->eaddr);