linux/net/ipv6
Martin KaFai Lau 3b4711757d ipv6: fix ipv6_cow_metrics for non DST_HOST case
ipv6_cow_metrics() currently assumes only DST_HOST routes require
dynamic metrics allocation from inetpeer.  The assumption breaks
when ndisc discovered router with RTAX_MTU and RTAX_HOPLIMIT metric.
Refer to ndisc_router_discovery() in ndisc.c and note that dst_metric_set()
is called after the route is created.

This patch creates the metrics array (by calling dst_cow_metrics_generic) in
ipv6_cow_metrics().

Test:
radvd.conf:
interface qemubr0
{
	AdvLinkMTU 1300;
	AdvCurHopLimit 30;

	prefix fd00:face:face:face::/64
	{
		AdvOnLink on;
		AdvAutonomous on;
		AdvRouterAddr off;
	};
};

Before:
[root@qemu1 ~]# ip -6 r show | egrep -v unreachable
fd00:face:face:face::/64 dev eth0  proto kernel  metric 256  expires 27sec
fe80::/64 dev eth0  proto kernel  metric 256
default via fe80::74df:d0ff:fe23:8ef2 dev eth0  proto ra  metric 1024  expires 27sec

After:
[root@qemu1 ~]# ip -6 r show | egrep -v unreachable
fd00:face:face:face::/64 dev eth0  proto kernel  metric 256  expires 27sec mtu 1300
fe80::/64 dev eth0  proto kernel  metric 256  mtu 1300
default via fe80::74df:d0ff:fe23:8ef2 dev eth0  proto ra  metric 1024  expires 27sec mtu 1300 hoplimit 30

Fixes: 8e2ec63917 (ipv6: don't use inetpeer to store metrics for routes.)
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-14 20:26:16 -08:00
..
netfilter netfilter: nf_tables: fix port natting in little endian archs 2014-12-23 15:34:28 +01:00
addrconf_core.c
addrconf.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-02-09 14:35:57 -08:00
addrlabel.c netlink: make nlmsg_end() and genlmsg_end() void 2015-01-18 01:03:45 -05:00
af_inet6.c
ah6.c
anycast.c
datagram.c net-timestamp: no-payload option 2015-02-02 18:46:51 -08:00
esp6.c
exthdrs_core.c
exthdrs_offload.c
exthdrs.c
fib6_rules.c
icmp.c ipv6:icmp:remove unnecessary brackets 2015-01-14 16:35:49 -05:00
inet6_connection_sock.c
inet6_hashtables.c
ip6_checksum.c
ip6_fib.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-01-27 16:59:56 -08:00
ip6_flowlabel.c ipv6: fix possible deadlock in ip6_fl_purge / ip6_fl_gc 2015-02-12 07:13:03 -08:00
ip6_gre.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-02-05 14:33:28 -08:00
ip6_icmp.c
ip6_input.c
ip6_offload.c
ip6_offload.h
ip6_output.c ipv6: Partial checksum only UDP packets 2015-02-11 14:32:08 -08:00
ip6_tunnel.c tunnels: advertise link netns via netlink 2015-01-19 14:32:03 -05:00
ip6_udp_tunnel.c udp: Do not require sock in udp_tunnel_xmit_skb 2015-01-24 23:15:40 -08:00
ip6_vti.c tunnels: advertise link netns via netlink 2015-01-19 14:32:03 -05:00
ip6mr.c netlink: make nlmsg_end() and genlmsg_end() void 2015-01-18 01:03:45 -05:00
ipcomp6.c
ipv6_sockglue.c ipv6: tcp: fix race in IPV6_2292PKTOPTIONS 2015-01-26 00:44:08 -08:00
Kconfig
Makefile
mcast.c
mip6.c
ndisc.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-02-09 14:35:57 -08:00
netfilter.c
output_core.c ipv6: Make __ipv6_select_ident static 2015-02-09 14:21:03 -08:00
ping.c ip: stash a pointer to msghdr in struct ping_fakehdr 2015-02-04 01:34:14 -05:00
proc.c
protocol.c
raw.c net: switch memcpy_fromiovec()/memcpy_fromiovecend() users to copy_from_iter() 2015-02-04 01:34:15 -05:00
reassembly.c
route.c ipv6: fix ipv6_cow_metrics for non DST_HOST case 2015-02-14 20:26:16 -08:00
sit.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-02-05 14:33:28 -08:00
syncookies.c
sysctl_net_ipv6.c
tcp_ipv6.c net: tcp: add per route congestion control 2015-01-05 22:55:24 -05:00
tcpv6_offload.c
tunnel6.c
udp_impl.h
udp_offload.c udp: Set SKB_GSO_UDP_TUNNEL* in UDP GRO path 2015-02-11 15:12:10 -08:00
udp.c udpv6: Add lockless sendmsg() support 2015-02-02 19:28:04 -08:00
udplite.c
xfrm6_input.c
xfrm6_mode_beet.c
xfrm6_mode_ro.c
xfrm6_mode_transport.c
xfrm6_mode_tunnel.c
xfrm6_output.c
xfrm6_policy.c
xfrm6_protocol.c
xfrm6_state.c
xfrm6_tunnel.c