Skip to contentSkip to conversation

fix -net user checks by reordering checks

PATCH In review Bas van Sisseren 3 participants 5 messages Jun 3, 2013 – Jun 18, 2013 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix -net user checks by reordering checks

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.

---
 net/slirp.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
net/slirp.c +6 -6
index b3f35d5..124e953 100644
@@ -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;
     }
 
Signature · 1 line
1.7.10.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Bas van Sisseren

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.

---
 net/slirp.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
#2 lore raw
Quoted 6 lines · Stefan Hajnoczi
Quoted 5 lines · Bas van Sisseren

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.

Quoted 6 lines
Quoted 4 lines
---
 net/slirp.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

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

Signature · 2 lines
Bas van Sisseren <[email protected]>
Quarantainenet
#3 lore raw
Quoted 12 lines · Bas van Sisseren
Quoted 11 lines · Stefan Hajnoczi
Quoted 9 lines · Bas van Sisseren

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.

---
 net/slirp.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
Quoted 6 lines
Quoted 1 line

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

#4 lore raw
In reply to Bas van Sisseren
Quoted 12 lines · Bas van Sisseren
Quoted 11 lines · Stefan Hajnoczi
Quoted 9 lines · Bas van Sisseren

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.

---
 net/slirp.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
Quoted 7 lines
Quoted 1 line

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

Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux