mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
41 lines
1.0 KiB
Diff
41 lines
1.0 KiB
Diff
diff --git a/ecm_interface.c b/ecm_interface.c
|
|
index b461456..6be872a 100644
|
|
--- a/ecm_interface.c
|
|
+++ b/ecm_interface.c
|
|
@@ -7493,9 +7493,13 @@
|
|
static int ecm_interface_wifi_event_rx(struct socket *sock, struct sockaddr_nl *addr, unsigned char *buf, int len)
|
|
{
|
|
struct msghdr msg;
|
|
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
|
|
struct iovec iov;
|
|
mm_segment_t oldfs;
|
|
int size;
|
|
+#else
|
|
+ struct kvec iov;
|
|
+#endif
|
|
|
|
iov.iov_base = buf;
|
|
iov.iov_len = len;
|
|
@@ -7505,9 +7509,10 @@
|
|
msg.msg_namelen = sizeof(struct sockaddr_nl);
|
|
msg.msg_control = NULL;
|
|
msg.msg_controllen = 0;
|
|
- iov_iter_init(&msg.msg_iter, READ, &iov, 1, 1);
|
|
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
|
|
oldfs = get_fs();
|
|
set_fs(KERNEL_DS);
|
|
+ iov_iter_init(&msg.msg_iter, READ, &iov, 1, 1);
|
|
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0))
|
|
size = sock_recvmsg(sock, &msg, len, msg.msg_flags);
|
|
#else
|
|
@@ -7516,6 +7521,9 @@
|
|
set_fs(oldfs);
|
|
|
|
return size;
|
|
+#else
|
|
+ return kernel_recvmsg(sock, &msg, &iov, 1, iov.iov_len, 0);
|
|
+#endif
|
|
}
|
|
|
|
/*
|