Created
March 18, 2018 14:55
-
-
Save mentha/2c65e69bd8895f0bda264139c6272a5a to your computer and use it in GitHub Desktop.
Linux usbip patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -udr a/libsrc/vhci_driver.c b/libsrc/vhci_driver.c | |
--- a/libsrc/vhci_driver.c 2018-03-18 22:07:40.126034770 +0800 | |
+++ b/libsrc/vhci_driver.c 2018-03-18 22:10:22.405106067 +0800 | |
@@ -150,7 +150,12 @@ | |
static int vhci_hcd_filter(const struct dirent *dirent) | |
{ | |
- return strcmp(dirent->d_name, "vhci_hcd") >= 0; | |
+ size_t l = strlen(dirent->d_name); | |
+ if (l < 8) | |
+ return 0; | |
+ if (memcmp(dirent->d_name, "vhci_hcd", 8)) | |
+ return 0; | |
+ return 1; | |
} | |
static int get_ncontrollers(void) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On my system the original filter matches
wdt
and thus usbip always fails finding the nonexist second controller. I changed it to match names beginning withvhci_hcd
.