[PATCH 1/1] l2tp: Fix the connect status check in pppol2tp_getname

Subsystems: networking [general], ppp over l2tp, the rest

STALE3666d

3 messages, 3 authors, 2016-08-20 · open the first message on its own page

[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

Re: [PATCH 1/1] l2tp: Fix the connect status check in pppol2tp_getname

From: Guillaume Nault <hidden>
Date: 2016-08-19 19:24:13

On Fri, Aug 19, 2016 at 01:36:23PM +0800, fgao@ikuai8.com wrote:
From: Gao Feng <redacted>

The sk->sk_state is bits flag, so need use bit operation check
instead of value check.
Tested-by: Guillaume Nault <redacted>

Re: [PATCH 1/1] l2tp: Fix the connect status check in pppol2tp_getname

From: David Miller <davem@davemloft.net>
Date: 2016-08-20 00:56:43

From: fgao@ikuai8.com
Date: Fri, 19 Aug 2016 13:36:23 +0800
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>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help