提交 56cff471 编写于 作者: G Gao Feng 提交者: 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: NGao Feng <fgao@ikuai8.com>
Tested-by: NGuillaume Nault <g.nault@alphalink.fr>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册