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:
Xi Wang 2012-08-26 16:37:07 +00:00 committed by David S. Miller
parent 6c9ff979d1
commit 46b66d7077
1 changed files with 2 additions and 2 deletions

View File

@ -1313,10 +1313,10 @@ static int dn_shutdown(struct socket *sock, int how)
if (scp->state == DN_O)
goto out;
if (how != SHUTDOWN_MASK)
if (how != SHUT_RDWR)
goto out;
sk->sk_shutdown = how;
sk->sk_shutdown = SHUTDOWN_MASK;
dn_destroy_sock(sk);
err = 0;