Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56cff471 authored by Gao Feng's avatar Gao Feng Committed by David S. Miller
Browse files

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: default avatarGao Feng <fgao@ikuai8.com>
Tested-by: default avatarGuillaume Nault <g.nault@alphalink.fr>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4c2f2454
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;