Skip to contentSkip to conversation

slirp: Fix default netmask to 255.255.255.0

PATCH In review Jan Kiszka 3 participants 6 messages Jul 2, 2009 – Jul 10, 2009

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 slirp: Fix default netmask to 255.255.255.0

This got broken between a13a4126c8 and c92ef6a22d: old slirp code used 255.255.255.0.

---

 net.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net.c +1 -1
index 6d82d59..8213134 100644
@@ -783,7 +783,7 @@ static int net_slirp_init(Monitor *mon, VLANState *vlan, const char *model,
 {
     /* default settings according to historic slirp */
     struct in_addr net  = { .s_addr = htonl(0x0a000000) }; /* 10.0.0.0 */
-    struct in_addr mask = { .s_addr = htonl(0xff000000) }; /* 255.0.0.0 */
+    struct in_addr mask = { .s_addr = htonl(0xffffff00) }; /* 255.255.255.0 */
     struct in_addr host = { .s_addr = htonl(0x0a000202) }; /* 10.0.2.2 */
     struct in_addr dhcp = { .s_addr = htonl(0x0a00020f) }; /* 10.0.2.15 */
     struct in_addr dns  = { .s_addr = htonl(0x0a000203) }; /* 10.0.2.3 */
#1 lore raw
Quoted 5 lines · Jan Kiszka

This got broken between a13a4126c8 and c92ef6a22d: old slirp code used 255.255.255.0.

I don't understand why, but this changeset breaks -net user for me. I get:

x86_64-softmmu/qemu-system-x86_64 -hda ~/images/linux.img -snapshot -L ~/git/qemu/pc-bios
qemu: Could not initialize device 'user'

Regards,

Anthony Liguori

author
#2 lore raw
Quoted 4 lines · Anthony Liguori
Quoted 3 lines · Jan Kiszka

This got broken between a13a4126c8 and c92ef6a22d: old slirp code used 255.255.255.0.

Quoted 8 lines
Quoted 2 lines

I don't understand why, but this changeset breaks -net user for me. I get:

x86_64-softmmu/qemu-system-x86_64 -hda ~/images/linux.img -snapshot -L ~/git/qemu/pc-bios
qemu: Could not initialize device 'user'

Weird, double-checking locally. Is linux.img raw or something else (you know, that pending -snapshot breakage with raw image...)?

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#3 lore raw
Quoted 12 lines · Jan Kiszka
Quoted 10 lines · Anthony Liguori
Quoted 6 lines · Jan Kiszka

This got broken between a13a4126c8 and c92ef6a22d: old slirp code used 255.255.255.0.

I don't understand why, but this changeset breaks -net user for me. I get:

Quoted 8 lines
Quoted 4 lines

x86_64-softmmu/qemu-system-x86_64 -hda ~/images/linux.img -snapshot -L ~/git/qemu/pc-bios
qemu: Could not initialize device 'user'

Weird, double-checking locally. Is linux.img raw or something else (you know, that pending -snapshot breakage with raw image...)?

It's a qcow2 and I don't know what -snapshot breakage you're referring to.

It's reproducible without -snapshot and reproducible directly on top of master (minus all the crap in staging).

Regards,

Anthony Liguori

Quoted 3 lines

Jan

author
#4 lore raw
Quoted 18 lines · Anthony Liguori
Quoted 17 lines · Jan Kiszka
Quoted 14 lines · Anthony Liguori
Quoted 5 lines · Jan Kiszka

This got broken between a13a4126c8 and c92ef6a22d: old slirp code used 255.255.255.0.

I don't understand why, but this changeset breaks -net user for me. I get:

x86_64-softmmu/qemu-system-x86_64 -hda ~/images/linux.img -snapshot -L ~/git/qemu/pc-bios
qemu: Could not initialize device 'user'

Quoted 5 lines
Quoted 3 lines

Weird, double-checking locally. Is linux.img raw or something else (you know, that pending -snapshot breakage with raw image...)?

It's a qcow2 and I don't know what -snapshot breakage you're referring to.

The one caused by Ram Pai's colon patch - but it was unrelated to this one.

Quoted 3 lines

It's reproducible without -snapshot and reproducible directly on top of master (minus all the crap in staging).

Hmpf, my bad. Use this patch instead:

------>

From: Jan Kiszka <[email protected]>
Subject: [PATCH] slirp: Fix default netmask to 255.255.255.0

This got broken between a13a4126c8 and c92ef6a22d: old slirp code used 255.255.255.0.

---

 net.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
net.c +2 -2
index 1507f37..a0c4153 100644
@@ -782,8 +782,8 @@ static int net_slirp_init(Monitor *mon, VLANState *vlan, const char *model,
                           const char *vsmbserver)
 {
     /* default settings according to historic slirp */
-    struct in_addr net  = { .s_addr = htonl(0x0a000000) }; /* 10.0.0.0 */
-    struct in_addr mask = { .s_addr = htonl(0xff000000) }; /* 255.0.0.0 */
+    struct in_addr net  = { .s_addr = htonl(0x0a000200) }; /* 10.0.2.0 */
+    struct in_addr mask = { .s_addr = htonl(0xffffff00) }; /* 255.255.255.0 */
     struct in_addr host = { .s_addr = htonl(0x0a000202) }; /* 10.0.2.2 */
     struct in_addr dhcp = { .s_addr = htonl(0x0a00020f) }; /* 10.0.2.15 */
     struct in_addr dns  = { .s_addr = htonl(0x0a000203) }; /* 10.0.2.3 */
#5 lore raw
Quoted 3 lines · Jan Kiszka

The one caused by Ram Pai's colon patch - but it was unrelated to this one.

That's been reverted.

Quoted 6 lines
Quoted 3 lines

It's reproducible without -snapshot and reproducible directly on top of master (minus all the crap in staging).

Hmpf, my bad. Use this patch instead:

That did the trick, thanks.

Signature · 3 lines
Regards,

Anthony Liguori