mirror of
https://github.com/xemu-project/xemu.git
synced 2025-02-07 12:48:02 +00:00
slirp: Give error message if hostfwd_add/remove for unrecognized vlan/stack
If the user specified a (vlan ID, slirp stack name) tuple in a monitor hostfwd_add/remove command and we can't find it, give the user an error message rather than silently doing nothing. This brings this error case in slirp_lookup() into line with the other two. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
4d121a5498
commit
b739ef05db
@ -282,6 +282,7 @@ static SlirpState *slirp_lookup(Monitor *mon, const char *vlan,
|
|||||||
NetClientState *nc;
|
NetClientState *nc;
|
||||||
nc = net_hub_find_client_by_name(strtol(vlan, NULL, 0), stack);
|
nc = net_hub_find_client_by_name(strtol(vlan, NULL, 0), stack);
|
||||||
if (!nc) {
|
if (!nc) {
|
||||||
|
monitor_printf(mon, "unrecognized (vlan-id, stackname) pair\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (strcmp(nc->model, "user")) {
|
if (strcmp(nc->model, "user")) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user