diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2019-10-08 11:00:19 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2019-10-08 11:00:19 +0100 |
commit | ce701584c53dd819ba000364d07da52a3744d343 (patch) | |
tree | d1d26d5ad8d800e6c89d8a0b22f6b0225959c04b | |
parent | 560009f2c8b57b7cdd31a5693ea86ab369382f49 (diff) | |
parent | 120b721f5b590393971673a315f02969ec89cccb (diff) |
Merge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into staging
slirp: Allow non-local DNS address when restrict is off
# gpg: Signature made Mon 07 Oct 2019 00:54:44 BST
# gpg: using RSA key 5ED9E856F7D6C6EAF51167A18D35C355720BBAFD
# gpg: Good signature from "Samuel Thibault <samuel.thibault@aquilenet.fr>" [unknown]
# gpg: aka "Samuel Thibault <sthibault@debian.org>" [marginal]
# gpg: aka "Samuel Thibault <samuel.thibault@gnu.org>" [unknown]
# gpg: aka "Samuel Thibault <samuel.thibault@inria.fr>" [marginal]
# gpg: aka "Samuel Thibault <samuel.thibault@labri.fr>" [marginal]
# gpg: aka "Samuel Thibault <samuel.thibault@ens-lyon.org>" [marginal]
# gpg: aka "Samuel Thibault <samuel.thibault@u-bordeaux.fr>" [unknown]
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg: It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 900C B024 B679 31D4 0F82 304B D017 8C76 7D06 9EE6
# Subkey fingerprint: 5ED9 E856 F7D6 C6EA F511 67A1 8D35 C355 720B BAFD
* remotes/thibault/tags/samuel-thibault:
slirp: Allow non-local DNS address when restrict is off
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | net/slirp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/slirp.c b/net/slirp.c index f42f496641..c4334ee876 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -456,7 +456,7 @@ static int net_slirp_init(NetClientState *peer, const char *model, error_setg(errp, "Failed to parse DNS"); return -1; } - if ((dns.s_addr & mask.s_addr) != net.s_addr) { + if (restricted && (dns.s_addr & mask.s_addr) != net.s_addr) { error_setg(errp, "DNS doesn't belong to network"); return -1; } @@ -522,7 +522,7 @@ static int net_slirp_init(NetClientState *peer, const char *model, error_setg(errp, "Failed to parse IPv6 DNS"); return -1; } - if (!in6_equal_net(&ip6_prefix, &ip6_dns, vprefix6_len)) { + if (restricted && !in6_equal_net(&ip6_prefix, &ip6_dns, vprefix6_len)) { error_setg(errp, "IPv6 DNS doesn't belong to network"); return -1; } |