Commit 56cff471 authored by Gao Feng's avatar Gao Feng Committed by David S. Miller

l2tp: Fix the connect status check in pppol2tp_getname

The sk->sk_state is bits flag, so need use bit operation check
instead of value check.
Signed-off-by: default avatarGao Feng <fgao@ikuai8.com>
Tested-by: default avatarGuillaume Nault <g.nault@alphalink.fr>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4c2f2454
......@@ -856,7 +856,7 @@ static int pppol2tp_getname(struct socket *sock, struct sockaddr *uaddr,
error = -ENOTCONN;
if (sk == NULL)
goto end;
if (sk->sk_state != PPPOX_CONNECTED)
if (!(sk->sk_state & PPPOX_CONNECTED))
goto end;
error = -EBADF;
......
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