LLC: sys_listen already checks for backlog > SOMAXCONN

also remove tests against SOCK_SEQPACKET, it is not supported
in llc_ui_create.
parent a7f3da32
...@@ -803,7 +803,7 @@ static int llc_ui_listen(struct socket *sock, int backlog) ...@@ -803,7 +803,7 @@ static int llc_ui_listen(struct socket *sock, int backlog)
if (sock->state != SS_UNCONNECTED) if (sock->state != SS_UNCONNECTED)
goto out; goto out;
rc = -EOPNOTSUPP; rc = -EOPNOTSUPP;
if (sk->type != SOCK_STREAM && sk->type != SOCK_SEQPACKET) if (sk->type != SOCK_STREAM)
goto out; goto out;
rc = -EAGAIN; rc = -EAGAIN;
if (sk->zapped) if (sk->zapped)
...@@ -811,8 +811,6 @@ static int llc_ui_listen(struct socket *sock, int backlog) ...@@ -811,8 +811,6 @@ static int llc_ui_listen(struct socket *sock, int backlog)
rc = 0; rc = 0;
if (!(unsigned)backlog) /* BSDism */ if (!(unsigned)backlog) /* BSDism */
backlog = 1; backlog = 1;
if ((unsigned)backlog > SOMAXCONN)
backlog = SOMAXCONN;
sk->max_ack_backlog = backlog; sk->max_ack_backlog = backlog;
if (sk->state != TCP_LISTEN) { if (sk->state != TCP_LISTEN) {
sk->ack_backlog = 0; sk->ack_backlog = 0;
...@@ -899,7 +897,7 @@ static int llc_ui_accept(struct socket *sock, struct socket *newsock, int flags) ...@@ -899,7 +897,7 @@ static int llc_ui_accept(struct socket *sock, struct socket *newsock, int flags)
int rc = -EOPNOTSUPP; int rc = -EOPNOTSUPP;
lock_sock(sk); lock_sock(sk);
if (sk->type != SOCK_SEQPACKET && sk->type != SOCK_STREAM) if (sk->type != SOCK_STREAM)
goto out; goto out;
rc = -EINVAL; rc = -EINVAL;
if (sock->state != SS_UNCONNECTED || sk->state != TCP_LISTEN) if (sock->state != SS_UNCONNECTED || sk->state != TCP_LISTEN)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment