netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] l2tp: Fix the connect status check in pppol2tp_getname
@ 2016-08-19  5:36 fgao
  2016-08-19 19:24 ` Guillaume Nault
  2016-08-20  0:56 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: fgao @ 2016-08-19  5:36 UTC (permalink / raw)
  To: jchapman, davem, g.nault, philipp, netdev; +Cc: gfree.wind, Gao Feng

From: Gao Feng <fgao@ikuai8.com>

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>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] l2tp: Fix the connect status check in pppol2tp_getname
  2016-08-19  5:36 [PATCH 1/1] l2tp: Fix the connect status check in pppol2tp_getname fgao
@ 2016-08-19 19:24 ` Guillaume Nault
  2016-08-20  0:56 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Guillaume Nault @ 2016-08-19 19:24 UTC (permalink / raw)
  To: fgao; +Cc: jchapman, davem, philipp, netdev, gfree.wind

On Fri, Aug 19, 2016 at 01:36:23PM +0800, fgao@ikuai8.com wrote:
> From: Gao Feng <fgao@ikuai8.com>
> 
> The sk->sk_state is bits flag, so need use bit operation check
> instead of value check.
> 

Tested-by: Guillaume Nault <g.nault@alphalink.fr>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] l2tp: Fix the connect status check in pppol2tp_getname
  2016-08-19  5:36 [PATCH 1/1] l2tp: Fix the connect status check in pppol2tp_getname fgao
  2016-08-19 19:24 ` Guillaume Nault
@ 2016-08-20  0:56 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-08-20  0:56 UTC (permalink / raw)
  To: fgao; +Cc: jchapman, g.nault, philipp, netdev, gfree.wind

From: fgao@ikuai8.com
Date: Fri, 19 Aug 2016 13:36:23 +0800

> From: Gao Feng <fgao@ikuai8.com>
> 
> 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>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-08-20  0:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-19  5:36 [PATCH 1/1] l2tp: Fix the connect status check in pppol2tp_getname fgao
2016-08-19 19:24 ` Guillaume Nault
2016-08-20  0:56 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).