X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=drivers%2Fstaging%2Fusbip%2Fuserspace%2Fsrc%2Fusbipd.c;h=f41ba5beb404377627a5b45fb49469876b1f9900;hb=7182f8f81a8c6425061c144d04477048826315e5;hp=f31b8b4246a36f5423629cdef0cd8afe60e8872f;hpb=9ead219b3150d864696f6476f37ecefb2f3e9d86;p=firefly-linux-kernel-4.4.55.git diff --git a/drivers/staging/usbip/userspace/src/usbipd.c b/drivers/staging/usbip/userspace/src/usbipd.c index f31b8b4246a3..f41ba5beb404 100644 --- a/drivers/staging/usbip/userspace/src/usbipd.c +++ b/drivers/staging/usbip/userspace/src/usbipd.c @@ -66,6 +66,9 @@ static const char usbipd_help_string[] = " Write process id to FILE.\n" " If no FILE specified, use " DEFAULT_PID_FILE "\n" "\n" + " -tPORT, --tcp-port PORT\n" + " Listen on TCP/IP port PORT.\n" + "\n" " -h, --help\n" " Print this help.\n" "\n" @@ -417,9 +420,9 @@ static struct addrinfo *do_getaddrinfo(char *host, int ai_family) hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE; - rc = getaddrinfo(host, USBIP_PORT_STRING, &hints, &ai_head); + rc = getaddrinfo(host, usbip_port_string, &hints, &ai_head); if (rc) { - err("failed to get a network address %s: %s", USBIP_PORT_STRING, + err("failed to get a network address %s: %s", usbip_port_string, gai_strerror(rc)); return NULL; } @@ -560,6 +563,7 @@ int main(int argc, char *argv[]) { "daemon", no_argument, NULL, 'D' }, { "debug", no_argument, NULL, 'd' }, { "pid", optional_argument, NULL, 'P' }, + { "tcp-port", required_argument, NULL, 't' }, { "help", no_argument, NULL, 'h' }, { "version", no_argument, NULL, 'v' }, { NULL, 0, NULL, 0 } @@ -583,7 +587,7 @@ int main(int argc, char *argv[]) cmd = cmd_standalone_mode; for (;;) { - opt = getopt_long(argc, argv, "DdP::hv", longopts, NULL); + opt = getopt_long(argc, argv, "DdP::t:hv", longopts, NULL); if (opt == -1) break; @@ -601,6 +605,9 @@ int main(int argc, char *argv[]) case 'P': pid_file = optarg ? optarg : DEFAULT_PID_FILE; break; + case 't': + usbip_setup_port_number(optarg); + break; case 'v': cmd = cmd_version; break;