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: Gao Feng <fgao@ikuai8.com> Tested-by: Guillaume Nault <g.nault@alphalink.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
4c2f245496
commit
56cff471d0
1 changed files with 1 additions and 1 deletions
|
@ -856,7 +856,7 @@ static int pppol2tp_getname(struct socket *sock, struct sockaddr *uaddr,
|
||||||
error = -ENOTCONN;
|
error = -ENOTCONN;
|
||||||
if (sk == NULL)
|
if (sk == NULL)
|
||||||
goto end;
|
goto end;
|
||||||
if (sk->sk_state != PPPOX_CONNECTED)
|
if (!(sk->sk_state & PPPOX_CONNECTED))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
error = -EBADF;
|
error = -EBADF;
|
||||||
|
|
Loading…
Reference in a new issue