slirp: Allow non-local DNS address when restrict is off
PATCH 1/1 slirp: Allow non-local DNS address when restrict is off
This can be used to set a DNS server to be used by the guest which is different from the one configured on the host.
This fixes LP 1010484.
--- net/slirp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/slirp.c +1 -1
@@ -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 ; }
Signature · 1 line
2.23.0
Quoted 7 lines · Samuel Thibault
This can be used to set a DNS server to be used by the guest which is different from the one configured on the host.
This fixes LP 1010484.
Signed-off-by Samuel Thibault <[email protected]>
Quoted 21 lines
--- net/slirp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/slirp.c +1
-2@@ -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 ; } --2.23.0
Signature · 1 line
Marc-André Lureau
Hi Samuel,
Quoted 4 lines · Samuel Thibault
This can be used to set a DNS server to be used by the guest which is different from the one configured on the host.
This fixes LP 1010484.
Wow, 7 years old...
Can you use this format, easier to understand for newcomers:
Quoted 12 lines
Signed-off-by Samuel Thibault <[email protected]>--- net/slirp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/slirp.c +0
-0
net/slirp.c static int net_slirp_init(NetClientState *peer, const char *model, · line 462
Quoted 8 lines
net/slirp.c +1
-1@@ -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 ; }
What about the IPv6 DNS?
Regards,
Phil.
Quoted 6 lines · Philippe Mathieu-Daudé
Hi Samuel,
Quoted 3 lines · Samuel Thibault
This can be used to set a DNS server to be used by the guest which is different from the one configured on the host.
Quoted 7 lines
Quoted 1 line
This fixes LP 1010484.
Wow, 7 years old...
Can you use this format, easier to understand for newcomers:
That should be "Buglink:" instead. "Fixes:" is for referencing previous commits. See our submit-a-patch page for more information:
https://wiki.qemu.org/Contribute/SubmitAPatch#Write_a_meaningful_commit_message
Thomas