diff options
Diffstat (limited to 'net/l2tp/l2tp_ip.c')
-rw-r--r-- | net/l2tp/l2tp_ip.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c index 70614e7affab..61d8b75d2686 100644 --- a/net/l2tp/l2tp_ip.c +++ b/net/l2tp/l2tp_ip.c | |||
@@ -464,10 +464,12 @@ static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m | |||
464 | sk->sk_bound_dev_if); | 464 | sk->sk_bound_dev_if); |
465 | if (IS_ERR(rt)) | 465 | if (IS_ERR(rt)) |
466 | goto no_route; | 466 | goto no_route; |
467 | if (connected) | 467 | if (connected) { |
468 | sk_setup_caps(sk, &rt->dst); | 468 | sk_setup_caps(sk, &rt->dst); |
469 | else | 469 | } else { |
470 | dst_release(&rt->dst); /* safe since we hold rcu_read_lock */ | 470 | skb_dst_set(skb, &rt->dst); |
471 | goto xmit; | ||
472 | } | ||
471 | } | 473 | } |
472 | 474 | ||
473 | /* We dont need to clone dst here, it is guaranteed to not disappear. | 475 | /* We dont need to clone dst here, it is guaranteed to not disappear. |
@@ -475,6 +477,7 @@ static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m | |||
475 | */ | 477 | */ |
476 | skb_dst_set_noref(skb, &rt->dst); | 478 | skb_dst_set_noref(skb, &rt->dst); |
477 | 479 | ||
480 | xmit: | ||
478 | /* Queue the packet to IP for output */ | 481 | /* Queue the packet to IP for output */ |
479 | rc = ip_queue_xmit(skb, &inet->cork.fl); | 482 | rc = ip_queue_xmit(skb, &inet->cork.fl); |
480 | rcu_read_unlock(); | 483 | rcu_read_unlock(); |