提交 ef824501 编写于 作者: S Shuah Khan 提交者: Greg Kroah-Hartman

usbip: list: don't list devices attached to vhci_hcd

usbip host lists devices attached to vhci_hcd on the same server
when user does attach over localhost or specifies the server as the
remote.

usbip attach -r localhost -b busid
or
usbip attach -r servername (or server IP)

Fix it to check and not list devices that are attached to vhci_hcd.

Cc: stable@vger.kernel.org
Signed-off-by: NShuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 ef54cf0c
......@@ -187,6 +187,7 @@ static int list_devices(bool parsable)
const char *busid;
char product_name[128];
int ret = -1;
const char *devpath;
/* Create libudev context. */
udev = udev_new();
......@@ -209,6 +210,14 @@ static int list_devices(bool parsable)
path = udev_list_entry_get_name(dev_list_entry);
dev = udev_device_new_from_syspath(udev, path);
/* Ignore devices attached to vhci_hcd */
devpath = udev_device_get_devpath(dev);
if (strstr(devpath, USBIP_VHCI_DRV_NAME)) {
dbg("Skip the device %s already attached to %s\n",
devpath, USBIP_VHCI_DRV_NAME);
continue;
}
/* Get device information. */
idVendor = udev_device_get_sysattr_value(dev, "idVendor");
idProduct = udev_device_get_sysattr_value(dev, "idProduct");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册