mirror of
https://github.com/RinCat/RTL88x2BU-Linux-Driver.git
synced 2026-01-19 10:26:35 +00:00
Linux 5.10 compat: remove set_fs()
This commit is contained in:
@@ -4250,7 +4250,9 @@ static int route_dump(u32 *gw_addr , int *gw_index)
|
||||
struct msghdr msg;
|
||||
struct iovec iov;
|
||||
struct sockaddr_nl nladdr;
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
|
||||
mm_segment_t oldfs;
|
||||
#endif
|
||||
char *pg;
|
||||
int size = 0;
|
||||
|
||||
@@ -4289,14 +4291,18 @@ static int route_dump(u32 *gw_addr , int *gw_index)
|
||||
msg.msg_controllen = 0;
|
||||
msg.msg_flags = MSG_DONTWAIT;
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
|
||||
oldfs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
#endif
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
|
||||
err = sock_sendmsg(sock, &msg);
|
||||
#else
|
||||
err = sock_sendmsg(sock, &msg, sizeof(req));
|
||||
#endif
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
|
||||
set_fs(oldfs);
|
||||
#endif
|
||||
|
||||
if (err < 0)
|
||||
goto out_sock;
|
||||
@@ -4321,14 +4327,18 @@ restart:
|
||||
iov_iter_init(&msg.msg_iter, READ, &iov, 1, PAGE_SIZE);
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
|
||||
oldfs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
#endif
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
|
||||
err = sock_recvmsg(sock, &msg, MSG_DONTWAIT);
|
||||
#else
|
||||
err = sock_recvmsg(sock, &msg, PAGE_SIZE, MSG_DONTWAIT);
|
||||
#endif
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
|
||||
set_fs(oldfs);
|
||||
#endif
|
||||
|
||||
if (err < 0)
|
||||
goto out_sock_pg;
|
||||
@@ -4399,14 +4409,18 @@ done:
|
||||
msg.msg_controllen = 0;
|
||||
msg.msg_flags = MSG_DONTWAIT;
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
|
||||
oldfs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
#endif
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
|
||||
err = sock_sendmsg(sock, &msg);
|
||||
#else
|
||||
err = sock_sendmsg(sock, &msg, sizeof(req));
|
||||
#endif
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
|
||||
set_fs(oldfs);
|
||||
#endif
|
||||
|
||||
if (err > 0)
|
||||
goto restart;
|
||||
|
||||
Reference in New Issue
Block a user