提交 a5e7c210 编写于 作者: D David S. Miller

[IPV6]: Fix leak added by udp connect dst caching fix.

Based upon a patch from Mitsuru KANDA <mk@linux-ipv6.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f36d6ab1
......@@ -852,10 +852,16 @@ static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk,
else if (!corkreq)
err = udp_v6_push_pending_frames(sk, up);
if (dst && connected)
ip6_dst_store(sk, dst,
ipv6_addr_equal(&fl->fl6_dst, &np->daddr) ?
&np->daddr : NULL);
if (dst) {
if (connected) {
ip6_dst_store(sk, dst,
ipv6_addr_equal(&fl->fl6_dst, &np->daddr) ?
&np->daddr : NULL);
} else {
dst_release(dst);
}
}
if (err > 0)
err = np->recverr ? net_xmit_errno(err) : 0;
release_sock(sk);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册