]> git.baikalelectronics.ru Git - kernel.git/commit
net/ipv6: do not copy dst flags on rt init
authorPeter Oskolkov <posk@google.com>
Mon, 17 Sep 2018 17:20:53 +0000 (10:20 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Sep 2018 02:42:14 +0000 (19:42 -0700)
commitb615b18354fd512d5a9b50a6dcfa4a1a2c18237f
tree23d727cb581ea70819fcf36316debf9939cf8bda
parentcfa29dacbc27aceedbc71525f532e3632d10187f
net/ipv6: do not copy dst flags on rt init

DST_NOCOUNT in dst_entry::flags tracks whether the entry counts
toward route cache size (net->ipv6.sysctl.ip6_rt_max_size).

If the flag is NOT set, dst_ops::pcpuc_entries counter is incremented
in dist_init() and decremented in dst_destroy().

This flag is tied to allocation/deallocation of dst_entry and
should not be copied from another dst/route. Otherwise it can happen
that dst_ops::pcpuc_entries counter grows until no new routes can
be allocated because the counter reached ip6_rt_max_size due to
DST_NOCOUNT not set and thus no counter decrements on gc-ed routes.

Fixes: c408f5f88565 ("net/ipv6: Move dst flags to booleans in fib entries")
Cc: David Ahern <dsahern@gmail.com>
Acked-by: Wei Wang <weiwan@google.com>
Signed-off-by: Peter Oskolkov <posk@google.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/route.c