diff options
author | Wei Wang <weiwan@google.com> | 2019-06-20 17:36:37 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-23 13:24:17 -0700 |
commit | 0e09edcce7ad9c8120eb8462334e1c9e8f3be09a (patch) | |
tree | c4e892bb20a039357fd2905f560a3692d37f6645 /fs/binfmt_flat.c | |
parent | 8c25c0cb5bb4e63170bb7760179ec294a3827694 (diff) | |
download | lwn-0e09edcce7ad9c8120eb8462334e1c9e8f3be09a.tar.gz lwn-0e09edcce7ad9c8120eb8462334e1c9e8f3be09a.zip |
ipv6: introduce RT6_LOOKUP_F_DST_NOREF flag in ip6_pol_route()
This new flag is to instruct the route lookup function to not take
refcnt on the dst entry. The user which does route lookup with this flag
must properly use rcu protection.
ip6_pol_route() is the major route lookup function for both tx and rx
path.
In this function:
Do not take refcnt on dst if RT6_LOOKUP_F_DST_NOREF flag is set, and
directly return the route entry. The caller should be holding rcu lock
when using this flag, and decide whether to take refcnt or not.
One note on the dst cache in the uncached_list:
As uncached_list does not consume refcnt, one refcnt is always returned
back to the caller even if RT6_LOOKUP_F_DST_NOREF flag is set.
Uncached dst is only possible in the output path. So in such call path,
caller MUST check if the dst is in the uncached_list before assuming
that there is no refcnt taken on the returned dst.
Signed-off-by: Wei Wang <weiwan@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Acked-by: Mahesh Bandewar <maheshb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/binfmt_flat.c')
0 files changed, 0 insertions, 0 deletions