]> git.baikalelectronics.ru Git - kernel.git/commit
ipv6: unshare inetpeers
authorEric Dumazet <eric.dumazet@gmail.com>
Tue, 19 Jul 2011 20:18:36 +0000 (20:18 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Jul 2011 04:24:25 +0000 (21:24 -0700)
commitb601ef4c6e4c2c83b9a8ef35e1bf1284cb988144
treea0ab4f071d257c4faa0bfa52051b4039ce3d1f96
parent0b114602ea1c8e6550d9accaecf96f0a6a03fdc0
ipv6: unshare inetpeers

We currently cow metrics a bit too soon in IPv6 case : All routes are
tied to a single inetpeer entry.

Change ip6_rt_copy() to get destination address as second argument, so
that we fill rt6i_dst before the dst_copy_metrics() call.

icmp6_dst_alloc() must set rt6i_dst before calling dst_metric_set(), or
else the cow is done while rt6i_dst is still NULL.

If orig route points to readonly metrics, we can share the pointer
instead of performing the memory allocation and copy.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/route.c