diff options
author | Gao Feng <fgao@ikuai8.com> | 2016-08-19 07:36:23 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-08-20 02:55:43 +0200 |
commit | 56cff471d0c62b721a298f806e7637501debb513 (patch) | |
tree | ac12d0a62c9fa0c9e0647caff49529b3abff0906 /net | |
parent | sctp: linearize early if it's not GSO (diff) | |
download | linux-56cff471d0c62b721a298f806e7637501debb513.tar.xz linux-56cff471d0c62b721a298f806e7637501debb513.zip |
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: Gao Feng <fgao@ikuai8.com>
Tested-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/l2tp/l2tp_ppp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c index d9560aa2dba3..232cb92033e8 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; |