All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] slirp: Allow non-local DNS address when restrict is off
@ 2019-09-29 18:13 Samuel Thibault
  2019-09-29 18:26 ` Marc-André Lureau
  2019-10-01  9:04 ` Philippe Mathieu-Daudé
  0 siblings, 2 replies; 5+ messages in thread
From: Samuel Thibault @ 2019-09-29 18:13 UTC (permalink / raw)
  To: qemu-devel, jasowang; +Cc: 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 <samuel.thibault@ens-lyon.org>
---
 net/slirp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/slirp.c b/net/slirp.c
index f42f496641..4d158b0542 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;
     }
-- 
2.23.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] slirp: Allow non-local DNS address when restrict is off
  2019-09-29 18:13 [PATCH] slirp: Allow non-local DNS address when restrict is off Samuel Thibault
@ 2019-09-29 18:26 ` Marc-André Lureau
  2019-10-01  9:04 ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 5+ messages in thread
From: Marc-André Lureau @ 2019-09-29 18:26 UTC (permalink / raw)
  To: Samuel Thibault; +Cc: Jason Wang, QEMU

On Sun, Sep 29, 2019 at 10:13 PM Samuel Thibault
<samuel.thibault@ens-lyon.org> wrote:
>
> 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 <samuel.thibault@ens-lyon.org>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> ---
>  net/slirp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/slirp.c b/net/slirp.c
> index f42f496641..4d158b0542 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;
>      }
> --
> 2.23.0
>
>


-- 
Marc-André Lureau


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] slirp: Allow non-local DNS address when restrict is off
  2019-09-29 18:13 [PATCH] slirp: Allow non-local DNS address when restrict is off Samuel Thibault
  2019-09-29 18:26 ` Marc-André Lureau
@ 2019-10-01  9:04 ` Philippe Mathieu-Daudé
  2019-10-01  9:31   ` Thomas Huth
  1 sibling, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-01  9:04 UTC (permalink / raw)
  To: Samuel Thibault, qemu-devel, jasowang; +Cc: Marc-André Lureau

Hi Samuel,

On 9/29/19 8:13 PM, Samuel Thibault wrote:
> 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:

Fixes: https://bugs.launchpad.net/qemu/+bug/1010484

> 
> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> ---
>   net/slirp.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/slirp.c b/net/slirp.c
> index f42f496641..4d158b0542 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;
>       }
> 

What about the IPv6 DNS?

Regards,

Phil.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] slirp: Allow non-local DNS address when restrict is off
  2019-10-01  9:04 ` Philippe Mathieu-Daudé
@ 2019-10-01  9:31   ` Thomas Huth
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2019-10-01  9:31 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Samuel Thibault, qemu-devel, jasowang
  Cc: Marc-André Lureau

On 01/10/2019 11.04, Philippe Mathieu-Daudé wrote:
> Hi Samuel,
> 
> On 9/29/19 8:13 PM, Samuel Thibault wrote:
>> 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:
> 
> Fixes: https://bugs.launchpad.net/qemu/+bug/1010484

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] slirp: Allow non-local DNS address when restrict is off
@ 2019-10-01 15:39 Samuel Thibault
  0 siblings, 0 replies; 5+ messages in thread
From: Samuel Thibault @ 2019-10-01 15:39 UTC (permalink / raw)
  To: qemu-devel, jasowang, marcandre.lureau, philmd; +Cc: 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.

Buglink: https://bugs.launchpad.net/qemu/+bug/1010484
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 net/slirp.c | 4 ++--
 1 file 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;
         }
-- 
2.23.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-10-01 15:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-29 18:13 [PATCH] slirp: Allow non-local DNS address when restrict is off Samuel Thibault
2019-09-29 18:26 ` Marc-André Lureau
2019-10-01  9:04 ` Philippe Mathieu-Daudé
2019-10-01  9:31   ` Thomas Huth
2019-10-01 15:39 Samuel Thibault

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.