diff options
author | Alex Shi <alex.shi@linaro.org> | 2016-12-12 22:16:26 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2016-12-12 22:16:26 +0800 |
commit | a057484ab40ff81f22a94bb62c035c78b5abd940 (patch) | |
tree | 770ed007ccc70bee7e533a7fe532dd8a774b1457 /net/l2tp/l2tp_ip.c | |
parent | 3ba1692e7239293d7bc5a596ca9b0707f5bc07d5 (diff) | |
parent | c95b7f1fab0c76882764a5196119237c8ad436ee (diff) |
Merge remote-tracking branch 'lts/linux-4.4.y' into linux-linaro-lsk-v4.4lsk-v4.4-16.12
Conflicts:
also change cpu_enable_uao in arch/arm64/include/asm/processor.h
comment unmatch fixed in arch/arm64/kernel/suspend.c
Diffstat (limited to 'net/l2tp/l2tp_ip.c')
-rw-r--r-- | net/l2tp/l2tp_ip.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c index 42de4ccd159f..d0e906d39642 100644 --- a/net/l2tp/l2tp_ip.c +++ b/net/l2tp/l2tp_ip.c @@ -251,8 +251,6 @@ static int l2tp_ip_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) int ret; int chk_addr_ret; - if (!sock_flag(sk, SOCK_ZAPPED)) - return -EINVAL; if (addr_len < sizeof(struct sockaddr_l2tpip)) return -EINVAL; if (addr->l2tp_family != AF_INET) @@ -267,6 +265,9 @@ static int l2tp_ip_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) read_unlock_bh(&l2tp_ip_lock); lock_sock(sk); + if (!sock_flag(sk, SOCK_ZAPPED)) + goto out; + if (sk->sk_state != TCP_CLOSE || addr_len < sizeof(struct sockaddr_l2tpip)) goto out; |