summaryrefslogtreecommitdiffstats
path: root/net/ipv6/udp.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2005-10-03 23:21:58 +0200
committerDavid S. Miller <davem@sunset.davemloft.net>2005-10-03 23:21:58 +0200
commita5e7c210fefd2454c757a3542e41063407ca7108 (patch)
tree24c5b867419a59b6cab36335468cef642dbcca66 /net/ipv6/udp.c
parent[IPV6]: Fix ipv6 fragment ID selection at slow path (diff)
downloadlinux-a5e7c210fefd2454c757a3542e41063407ca7108.tar.xz
linux-a5e7c210fefd2454c757a3542e41063407ca7108.zip
[IPV6]: Fix leak added by udp connect dst caching fix.
Based upon a patch from Mitsuru KANDA <mk@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--net/ipv6/udp.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 6001948600f3..e4cad11f284a 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -852,10 +852,16 @@ do_append_data:
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);