[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 1/9] slirp: allow host port 0 for hostfwd
From: |
Samuel Thibault |
Subject: |
[Qemu-devel] [PULL 1/9] slirp: allow host port 0 for hostfwd |
Date: |
Sat, 29 Apr 2017 18:47:42 +0200 |
From: Vincent Bernat <address@hidden>
The OS will allocate automatically a free port. This is useful if you
want to be sure to not get any port conflict. You still have to figure
out which port you got, for example with "lsof" (this could be exposed
in the monitor if needed).
Example of use:
$ qemu-system-x86_64 -net user,hostfwd=127.0.0.1:0-:22 ...
Then, get your port with:
$ lsof -np 1474 | grep LISTEN
qemu-syst 31777 bernat 12u IPv4 [...] TCP 127.0.0.1:35145 (LISTEN)
Signed-off-by: Vincent Bernat <address@hidden>
Signed-off-by: Samuel Thibault <address@hidden>
---
net/slirp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/slirp.c b/net/slirp.c
index f97ec23345..11b2dd249a 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -487,7 +487,7 @@ static int slirp_hostfwd(SlirpState *s, const char
*redir_str,
goto fail_syntax;
}
host_port = strtol(buf, &end, 0);
- if (*end != '\0' || host_port < 1 || host_port > 65535) {
+ if (*end != '\0' || host_port < 0 || host_port > 65535) {
goto fail_syntax;
}
--
2.11.0
- [Qemu-devel] [PULL 0/9] slirp updates, Samuel Thibault, 2017/04/29
- [Qemu-devel] [PULL 3/9] slirp: tftp, copy sockaddr_size, Samuel Thibault, 2017/04/29
- [Qemu-devel] [PULL 4/9] slirp: fix pinging the virtual ipv4 DNS server, Samuel Thibault, 2017/04/29
- [Qemu-devel] [PULL 1/9] slirp: allow host port 0 for hostfwd,
Samuel Thibault <=
- [Qemu-devel] [PULL 7/9] slirp: Common lhost/fhost union, Samuel Thibault, 2017/04/29
- [Qemu-devel] [PULL 2/9] slirp/smb: Replace constant strings by glib string, Samuel Thibault, 2017/04/29
- [Qemu-devel] [PULL 9/9] slirp: VMStatify remaining except for loop, Samuel Thibault, 2017/04/29
- [Qemu-devel] [PULL 6/9] slirp: VMStatify sbuf, Samuel Thibault, 2017/04/29
- [Qemu-devel] [PULL 8/9] slirp: VMStatify socket level, Samuel Thibault, 2017/04/29
- [Qemu-devel] [PULL 5/9] slirp: VMState conversion; tcpcb, Samuel Thibault, 2017/04/29
- Re: [Qemu-devel] [PULL 0/9] slirp updates, no-reply, 2017/04/29