Patchwork [slirp] fix -net user checks by reordering checks

login
register
mail settings
Submitter Bas van Sisseren
Date June 3, 2013, 1:11 p.m.
Message ID <1370265109-8753-1-git-send-email-bas@quarantainenet.nl>
Download mbox | patch
Permalink /patch/248292/
State New
Headers show

Comments

Bas van Sisseren - June 3, 2013, 1:11 p.m.
reorder slirp config options. first check the dns-server-address,
then check the first-dhcp-address. the original code was comparing
the first-dhcp-address with the default dns-server-address, not
the configured dns-server-address.

Signed-off-by: Bas van Sisseren <bas@quarantainenet.nl>
---
 net/slirp.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
Stefan Hajnoczi - June 4, 2013, 12:26 p.m.
On Mon, Jun 03, 2013 at 03:11:49PM +0200, Bas van Sisseren wrote:
> reorder slirp config options. first check the dns-server-address,
> then check the first-dhcp-address. the original code was comparing
> the first-dhcp-address with the default dns-server-address, not
> the configured dns-server-address.
> 
> Signed-off-by: Bas van Sisseren <bas@quarantainenet.nl>
> ---
>  net/slirp.c |   12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Bas van Sisseren - June 17, 2013, 11:41 a.m.
On 04/06/13 14:26, Stefan Hajnoczi wrote:
> On Mon, Jun 03, 2013 at 03:11:49PM +0200, Bas van Sisseren wrote:
>> reorder slirp config options. first check the dns-server-address,
>> then check the first-dhcp-address. the original code was comparing
>> the first-dhcp-address with the default dns-server-address, not
>> the configured dns-server-address.
>>
>> Signed-off-by: Bas van Sisseren <bas@quarantainenet.nl>
>> ---
>>  net/slirp.c |   12 ++++++------
>>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

Hello qemu-devel list,

The last reaction was 2 weeks ago. Do I need more reviews for inclusion of
the patch?


Regards,

Bas van Sisseren
Stefan Hajnoczi - June 17, 2013, 12:39 p.m.
On Mon, Jun 17, 2013 at 01:41:40PM +0200, Bas van Sisseren wrote:
> On 04/06/13 14:26, Stefan Hajnoczi wrote:
> > On Mon, Jun 03, 2013 at 03:11:49PM +0200, Bas van Sisseren wrote:
> >> reorder slirp config options. first check the dns-server-address,
> >> then check the first-dhcp-address. the original code was comparing
> >> the first-dhcp-address with the default dns-server-address, not
> >> the configured dns-server-address.
> >>
> >> Signed-off-by: Bas van Sisseren <bas@quarantainenet.nl>
> >> ---
> >>  net/slirp.c |   12 ++++++------
> >>  1 file changed, 6 insertions(+), 6 deletions(-)
> > 
> > Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> 
> Hello qemu-devel list,
> 
> The last reaction was 2 weeks ago. Do I need more reviews for inclusion of
> the patch?

Jan is/was probably just away because of LinuxCon Japan
(http://events.linuxfoundation.org/events/linuxcon-japan).  I'm sure
he'll be back soon and your patch will make it in time for the QEMU 1.6
release.

Stefan
Jan Kiszka - June 18, 2013, 1:31 p.m.
On 2013-06-17 13:41, Bas van Sisseren wrote:
> On 04/06/13 14:26, Stefan Hajnoczi wrote:
>> On Mon, Jun 03, 2013 at 03:11:49PM +0200, Bas van Sisseren wrote:
>>> reorder slirp config options. first check the dns-server-address,
>>> then check the first-dhcp-address. the original code was comparing
>>> the first-dhcp-address with the default dns-server-address, not
>>> the configured dns-server-address.
>>>
>>> Signed-off-by: Bas van Sisseren <bas@quarantainenet.nl>
>>> ---
>>>  net/slirp.c |   12 ++++++------
>>>  1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> 
> Hello qemu-devel list,
> 
> The last reaction was 2 weeks ago. Do I need more reviews for inclusion of
> the patch?
> 

Nope, thanks, just applied to my slirp queue.

Jan

Patch

diff --git a/net/slirp.c b/net/slirp.c
index b3f35d5..124e953 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -212,19 +212,19 @@  static int net_slirp_init(NetClientState *peer, const char *model,
         return -1;
     }
 
-    if (vdhcp_start && !inet_aton(vdhcp_start, &dhcp)) {
+    if (vnameserver && !inet_aton(vnameserver, &dns)) {
         return -1;
     }
-    if ((dhcp.s_addr & mask.s_addr) != net.s_addr ||
-        dhcp.s_addr == host.s_addr || dhcp.s_addr == dns.s_addr) {
+    if ((dns.s_addr & mask.s_addr) != net.s_addr ||
+        dns.s_addr == host.s_addr) {
         return -1;
     }
 
-    if (vnameserver && !inet_aton(vnameserver, &dns)) {
+    if (vdhcp_start && !inet_aton(vdhcp_start, &dhcp)) {
         return -1;
     }
-    if ((dns.s_addr & mask.s_addr) != net.s_addr ||
-        dns.s_addr == host.s_addr) {
+    if ((dhcp.s_addr & mask.s_addr) != net.s_addr ||
+        dhcp.s_addr == host.s_addr || dhcp.s_addr == dns.s_addr) {
         return -1;
     }