]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
l2tp: Fix the connect status check in pppol2tp_getname
authorGao Feng <fgao@ikuai8.com>
Fri, 19 Aug 2016 05:36:23 +0000 (13:36 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 20 Aug 2016 00:55:43 +0000 (17:55 -0700)
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>
Tested-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/l2tp/l2tp_ppp.c

index d9560aa2dba38d87561548b5ff8fae897e034810..232cb92033e8225f76d72deb5af5ef93c4d6187f 100644 (file)
@@ -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;