decnet: fix shutdown parameter checking
The allowed value of "how" is SHUT_RD/SHUT_WR/SHUT_RDWR (0/1/2), rather than SHUTDOWN_MASK (3). Signed-off-by: Xi Wang <xi.wang@gmail.com> Acked-by: Steven Whitehouse <swhiteho@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Родитель
6c9ff979d1
Коммит
46b66d7077
|
@ -1313,10 +1313,10 @@ static int dn_shutdown(struct socket *sock, int how)
|
||||||
if (scp->state == DN_O)
|
if (scp->state == DN_O)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (how != SHUTDOWN_MASK)
|
if (how != SHUT_RDWR)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
sk->sk_shutdown = how;
|
sk->sk_shutdown = SHUTDOWN_MASK;
|
||||||
dn_destroy_sock(sk);
|
dn_destroy_sock(sk);
|
||||||
err = 0;
|
err = 0;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче