[PATCH 1/1] l2tp: Fix the connect status check in pppol2tp_getname
From: <hidden>
Date: 2016-08-19 05:36:47
From: Gao Feng <redacted> The sk->sk_state is bits flag, so need use bit operation check instead of value check. Signed-off-by: Gao Feng <redacted> --- net/l2tp/l2tp_ppp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c
index d9560aa..232cb92 100644
--- a/net/l2tp/l2tp_ppp.c
+++ b/net/l2tp/l2tp_ppp.c@@ -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;
--
1.9.1