diff options
-rw-r--r-- | src/socket.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/socket.c b/src/socket.c index 656c319..cd2f89e 100644 --- a/src/socket.c +++ b/src/socket.c @@ -822,7 +822,7 @@ void sofwdrain(struct socket *so) static bool sotranslate_out4(Slirp *s, struct socket *so, struct sockaddr_in *sin) { if (!s->disable_dns && so->so_faddr.s_addr == s->vnameserver_addr.s_addr) { - return get_dns_addr(&sin->sin_addr) >= 0; + return so->so_fport == htons(53) && get_dns_addr(&sin->sin_addr) >= 0; } if (so->so_faddr.s_addr == s->vhost_addr.s_addr || @@ -841,7 +841,7 @@ static bool sotranslate_out6(Slirp *s, struct socket *so, struct sockaddr_in6 *s { if (!s->disable_dns && in6_equal(&so->so_faddr6, &s->vnameserver_addr6)) { uint32_t scope_id; - if (get_dns6_addr(&sin->sin6_addr, &scope_id) >= 0) { + if (so->so_fport == htons(53) && get_dns6_addr(&sin->sin6_addr, &scope_id) >= 0) { sin->sin6_scope_id = scope_id; return true; } |