]> git.ipfire.org Git - thirdparty/kernel/linux.git/blobdiff - net/tipc/socket.c
Merge tag 'net-accept-more-20240515' of git://git.kernel.dk/linux
[thirdparty/kernel/linux.git] / net / tipc / socket.c
index 798397b6811e1b88be3aee4c91abc2df4c46ed38..2d58ecae4e2109d2c589440d5fff708638d4d55a 100644 (file)
@@ -146,8 +146,6 @@ static void tipc_data_ready(struct sock *sk);
 static void tipc_write_space(struct sock *sk);
 static void tipc_sock_destruct(struct sock *sk);
 static int tipc_release(struct socket *sock);
-static int tipc_accept(struct socket *sock, struct socket *new_sock, int flags,
-                      bool kern);
 static void tipc_sk_timeout(struct timer_list *t);
 static int tipc_sk_publish(struct tipc_sock *tsk, struct tipc_uaddr *ua);
 static int tipc_sk_withdraw(struct tipc_sock *tsk, struct tipc_uaddr *ua);
@@ -2711,13 +2709,12 @@ static int tipc_wait_for_accept(struct socket *sock, long timeo)
  * tipc_accept - wait for connection request
  * @sock: listening socket
  * @new_sock: new socket that is to be connected
- * @flags: file-related flags associated with socket
- * @kern: caused by kernel or by userspace?
+ * @arg: arguments for accept
  *
  * Return: 0 on success, errno otherwise
  */
-static int tipc_accept(struct socket *sock, struct socket *new_sock, int flags,
-                      bool kern)
+static int tipc_accept(struct socket *sock, struct socket *new_sock,
+                      struct proto_accept_arg *arg)
 {
        struct sock *new_sk, *sk = sock->sk;
        struct tipc_sock *new_tsock;
@@ -2733,14 +2730,14 @@ static int tipc_accept(struct socket *sock, struct socket *new_sock, int flags,
                res = -EINVAL;
                goto exit;
        }
-       timeo = sock_rcvtimeo(sk, flags & O_NONBLOCK);
+       timeo = sock_rcvtimeo(sk, arg->flags & O_NONBLOCK);
        res = tipc_wait_for_accept(sock, timeo);
        if (res)
                goto exit;
 
        buf = skb_peek(&sk->sk_receive_queue);
 
-       res = tipc_sk_create(sock_net(sock->sk), new_sock, 0, kern);
+       res = tipc_sk_create(sock_net(sock->sk), new_sock, 0, arg->kern);
        if (res)
                goto exit;
        security_sk_clone(sock->sk, new_sock->sk);