mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
slirp: factor out guestfwd addition checks
This will allow reusing the function in a following patch. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
This commit is contained in:
parent
a857d91d8c
commit
4246e8cac7
2 changed files with 21 additions and 9 deletions
|
@ -37,13 +37,6 @@ int add_exec(struct gfwd_list **ex_ptr, void *chardev, const char *cmdline,
|
|||
{
|
||||
struct gfwd_list *tmp_ptr;
|
||||
|
||||
/* First, check if the port is "bound" */
|
||||
for (tmp_ptr = *ex_ptr; tmp_ptr; tmp_ptr = tmp_ptr->ex_next) {
|
||||
if (port == tmp_ptr->ex_fport &&
|
||||
addr.s_addr == tmp_ptr->ex_addr.s_addr)
|
||||
return -1;
|
||||
}
|
||||
|
||||
tmp_ptr = *ex_ptr;
|
||||
*ex_ptr = g_new0(struct gfwd_list, 1);
|
||||
(*ex_ptr)->ex_fport = port;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue