Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. diff -ur vmnet-only.a/driver.c vmnet-only/driver.c
  2. --- vmnet-only.a/driver.c 2014-11-20 20:13:56.000000000 -0500
  3. +++ vmnet-only/driver.c 2015-02-09 15:40:10.916640592 -0500
  4. @@ -265,10 +265,17 @@
  5. {
  6. int ret = -ENOTTY;
  7.  
  8. +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
  9. if (filp && filp->f_op && filp->f_op->ioctl == VNetFileOpIoctl) {
  10. ret = VNetFileOpIoctl(filp->f_dentry->d_inode, filp, iocmd, ioarg);
  11. }
  12. return ret;
  13. +#else
  14. + if (filp && filp->f_op && filp->f_op->ioctl == VNetFileOpIoctl) {
  15. + ret = VNetFileOpIoctl(filp->f_path.dentry->d_inode, filp, iocmd, ioarg);
  16. + }
  17. + return ret;
  18. +#endif
  19. }
  20.  
  21.  
  22. @@ -1191,11 +1198,19 @@
  23. struct inode *inode = NULL;
  24. long err;
  25.  
  26. +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
  27. if (filp && filp->f_dentry) {
  28. inode = filp->f_dentry->d_inode;
  29. }
  30. err = VNetFileOpIoctl(inode, filp, iocmd, ioarg);
  31. return err;
  32. +#else
  33. + if (filp && filp->f_path.dentry) {
  34. + inode = filp->f_path.dentry->d_inode;
  35. + }
  36. + err = VNetFileOpIoctl(inode, filp, iocmd, ioarg);
  37. + return err;
  38. +#endif
  39. }
  40. #endif
  41.  
  42. diff -ur vmnet-only.a/userif.c vmnet-only/userif.c
  43. --- vmnet-only.a/userif.c 2014-11-20 20:13:56.000000000 -0500
  44. +++ vmnet-only/userif.c 2015-02-09 15:41:02.150847338 -0500
  45. @@ -523,7 +523,13 @@
  46. .iov_base = buf,
  47. .iov_len = len,
  48. };
  49. +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
  50. return skb_copy_datagram_iovec(skb, 0, &iov, len);
  51. +#else
  52. + struct iov_iter to;
  53. + iov_iter_init(&to, READ, &iov, 1, len);
  54. + return skb_copy_datagram_iter(skb, 0, &to, len);
  55. +#endif
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement