aboutsummaryrefslogtreecommitdiffstats
path: root/net/l2tp/l2tp_ip.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/l2tp/l2tp_ip.c')
-rw-r--r--net/l2tp/l2tp_ip.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c
index adefe5225dca..c89a32fb5d5e 100644
--- a/net/l2tp/l2tp_ip.c
+++ b/net/l2tp/l2tp_ip.c
@@ -393,8 +393,9 @@ static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m
393 393
394 daddr = lip->l2tp_addr.s_addr; 394 daddr = lip->l2tp_addr.s_addr;
395 } else { 395 } else {
396 rc = -EDESTADDRREQ;
396 if (sk->sk_state != TCP_ESTABLISHED) 397 if (sk->sk_state != TCP_ESTABLISHED)
397 return -EDESTADDRREQ; 398 goto out;
398 399
399 daddr = inet->inet_daddr; 400 daddr = inet->inet_daddr;
400 connected = 1; 401 connected = 1;