Skip to content

Commit

Permalink
decnet: fix shutdown parameter checking
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Xi Wang authored and David S. Miller committed Aug 31, 2012
1 parent 6c9ff97 commit 46b66d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/decnet/af_decnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 46b66d7

Please sign in to comment.