lkml.org 
[lkml]   [2012]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] decnet: fix shutdown parameter checking
    Date
    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>
    ---
    net/decnet/af_decnet.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
    index 2ba1a28..307c322 100644
    --- a/net/decnet/af_decnet.c
    +++ b/net/decnet/af_decnet.c
    @@ -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;

    --
    1.7.9.5


    \
     
     \ /
      Last update: 2012-08-27 05:21    [W:0.020 / U:0.448 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site