diff options
author | Daniel Fullmer <danielrf12@gmail.com> | 2022-07-25 19:51:34 -0700 |
---|---|---|
committer | Daniel Fullmer <danielrf12@gmail.com> | 2022-07-27 20:01:20 -0700 |
commit | bf307aeb470f40ffc41ecc909fbd2e65cda3640e (patch) | |
tree | e1c457b9380b302e68470de32e5a9fa3dc02f484 | |
parent | b93c4cae1aebda786a478677d6364308e4579ade (diff) |
usbredirect: listen on correct address
Previously, usbredirect would ignore the listen address passed via
`--as <addr>:<port>`, and would always listen on the loopback interface.
This corrects that behavior.
Signed-off-by: Daniel Fullmer <danielrf12@gmail.com>
-rw-r--r-- | tools/usbredirect.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/usbredirect.c b/tools/usbredirect.c index 5e2376c..ff910ab 100644 --- a/tools/usbredirect.c +++ b/tools/usbredirect.c @@ -567,7 +567,12 @@ main(int argc, char *argv[]) GSocketService *socket_service; socket_service = g_socket_service_new (); - GInetAddress *iaddr = g_inet_address_new_loopback(G_SOCKET_FAMILY_IPV4); + GInetAddress *iaddr = g_inet_address_new_from_string(self->addr); + if (iaddr == NULL) { + g_warning("Failed to parse IP: %s", self->addr); + goto end; + } + GSocketAddress *saddr = g_inet_socket_address_new(iaddr, self->port); g_object_unref(iaddr); |