Skip to contentSkip to conversation

slirp: Honour vlan/stack in hostfwd_remove commands

PATCH In review Peter Maydell 3 participants 6 messages Jun 16, 2014 – Sep 2, 2014 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 slirp: Honour vlan/stack in hostfwd_remove commands

The hostfwd_add and hostfwd_remove monitor commands allow the user to optionally specify a vlan/stack tuple. hostfwd_add honours this, but hostfwd_remove does not (it looks up the tuple but then ignores the SlirpState it has looked up and always uses the first stack in the list anyway). Correct this to honour what the user requested.

---
 net/slirp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/slirp.c +1 -2
index 647039e..c171119 100644
@@ -345,8 +345,7 @@ void net_slirp_hostfwd_remove(Monitor *mon, const QDict *qdict)
 
     host_port = atoi(p);
 
-    err = slirp_remove_hostfwd(QTAILQ_FIRST(&slirp_stacks)->slirp, is_udp,
-                               host_addr, host_port);
+    err = slirp_remove_hostfwd(s->slirp, is_udp, host_addr, host_port);
 
     monitor_printf(mon, "host forwarding rule for %s %s\n", src_str,
                    err ? "not found" : "removed");
Signature · 1 line
1.9.2
#1 lore raw
Quoted 26 lines · Peter Maydell

The hostfwd_add and hostfwd_remove monitor commands allow the user to optionally specify a vlan/stack tuple. hostfwd_add honours this, but hostfwd_remove does not (it looks up the tuple but then ignores the SlirpState it has looked up and always uses the first stack in the list anyway). Correct this to honour what the user requested.

---
 net/slirp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/slirp.c +1 -3
index 647039e..c171119 100644
@@ -345,8 +345,7 @@ void net_slirp_hostfwd_remove(Monitor *mon, const QDict *qdict)
 
     host_port = atoi(p);
 
-    err = slirp_remove_hostfwd(QTAILQ_FIRST(&slirp_stacks)->slirp, is_udp,
-                               host_addr, host_port);
+    err = slirp_remove_hostfwd(s->slirp, is_udp, host_addr, host_port);
 
     monitor_printf(mon, "host forwarding rule for %s %s\n", src_str,
                    err ? "not found" : "removed");
--
Quoted 1 line

1.9.2

Ping! (and cc trivial).

thanks
-- PMM

#2 lore raw
Quoted 24 lines · Peter Maydell
Quoted 23 lines · Peter Maydell

The hostfwd_add and hostfwd_remove monitor commands allow the user to optionally specify a vlan/stack tuple. hostfwd_add honours this, but hostfwd_remove does not (it looks up the tuple but then ignores the SlirpState it has looked up and always uses the first stack in the list anyway). Correct this to honour what the user requested.

---
 net/slirp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/slirp.c +1 -2
index 647039e..c171119 100644
@@ -345,8 +345,7 @@ void net_slirp_hostfwd_remove(Monitor *mon, const QDict *qdict)
 
     host_port = atoi(p);
 
-    err = slirp_remove_hostfwd(QTAILQ_FIRST(&slirp_stacks)->slirp, is_udp,
-                               host_addr, host_port);
+    err = slirp_remove_hostfwd(s->slirp, is_udp, host_addr, host_port);
 
Quoted 6 lines
Quoted 4 lines
net/slirp.c +0 -1
     monitor_printf(mon, "host forwarding rule for %s %s\n", src_str,
                    err ? "not found" : "removed");
--

1.9.2

Ping! (and cc trivial).

Ping^2.

thanks
-- PMM

#3 lore raw
Quoted 25 lines · Peter Maydell
Quoted 24 lines · Peter Maydell
Quoted 23 lines · Peter Maydell

The hostfwd_add and hostfwd_remove monitor commands allow the user to optionally specify a vlan/stack tuple. hostfwd_add honours this, but hostfwd_remove does not (it looks up the tuple but then ignores the SlirpState it has looked up and always uses the first stack in the list anyway). Correct this to honour what the user requested.

---
 net/slirp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/slirp.c +1 -2
index 647039e..c171119 100644
@@ -345,8 +345,7 @@ void net_slirp_hostfwd_remove(Monitor *mon, const QDict *qdict)
 
     host_port = atoi(p);
 
-    err = slirp_remove_hostfwd(QTAILQ_FIRST(&slirp_stacks)->slirp, is_udp,
-                               host_addr, host_port);
+    err = slirp_remove_hostfwd(s->slirp, is_udp, host_addr, host_port);
 
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
net/slirp.c +0 -1
     monitor_printf(mon, "host forwarding rule for %s %s\n", src_str,
                    err ? "not found" : "removed");
--

1.9.2

Ping! (and cc trivial).

Ping^2.

Ping^3 :-(

-- PMM

#4 lore raw
Quoted 33 lines · Peter Maydell
Quoted 32 lines · Peter Maydell
Quoted 30 lines · Peter Maydell
Quoted 26 lines · Peter Maydell

The hostfwd_add and hostfwd_remove monitor commands allow the user to optionally specify a vlan/stack tuple. hostfwd_add honours this, but hostfwd_remove does not (it looks up the tuple but then ignores the SlirpState it has looked up and always uses the first stack in the list anyway). Correct this to honour what the user requested.

---
 net/slirp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/slirp.c +1 -3
index 647039e..c171119 100644
@@ -345,8 +345,7 @@ void net_slirp_hostfwd_remove(Monitor *mon, const QDict *qdict)
 
     host_port = atoi(p);
 
-    err = slirp_remove_hostfwd(QTAILQ_FIRST(&slirp_stacks)->slirp, is_udp,
-                               host_addr, host_port);
+    err = slirp_remove_hostfwd(s->slirp, is_udp, host_addr, host_port);
 
     monitor_printf(mon, "host forwarding rule for %s %s\n", src_str,
                    err ? "not found" : "removed");
--
Quoted 1 line

1.9.2

Ping! (and cc trivial).

Quoted 3 lines
Quoted 1 line

Ping^2.

Ping^3 :-(

Sorry, you will probably need someone else for these topics. I've difficulties scheduling these into my todo list. :(

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux
#5 lore raw
In reply to Peter Maydell
Quoted 6 lines · Peter Maydell
Quoted 5 lines · Peter Maydell

The hostfwd_add and hostfwd_remove monitor commands allow the user to optionally specify a vlan/stack tuple. hostfwd_add honours this, but hostfwd_remove does not (it looks up the tuple but then ignores the SlirpState it has looked up and always uses the first stack in the list anyway). Correct this to honour what the user requested.

I've applied this to -trivial. Somehow this patch has been marked as "handled" in my queue, but actually it weren't - that's why I haven't really seen the pings.

Thanks,

/mjt