aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ipv6.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-05-28 07:12:34 +0200
committerDavid S. Miller <davem@davemloft.net>2020-05-28 11:11:46 -0700
commit7d7207c2d57080af93fc323dc6a85bd79207b4c6 (patch)
tree841e6426424bcd7b571fd88072668d6e3edd27bc /include/net/ipv6.h
parentipv6: add ip6_sock_set_addr_preferences (diff)
downloadlinux-dev-7d7207c2d57080af93fc323dc6a85bd79207b4c6.tar.xz
linux-dev-7d7207c2d57080af93fc323dc6a85bd79207b4c6.zip
ipv6: add ip6_sock_set_recvpktinfo
Add a helper to directly set the IPV6_RECVPKTINFO sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ipv6.h')
-rw-r--r--include/net/ipv6.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 9a9075983016..5e65bf2fd32d 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -1262,4 +1262,11 @@ static inline int ip6_sock_set_addr_preferences(struct sock *sk, bool val)
return ret;
}
+static inline void ip6_sock_set_recvpktinfo(struct sock *sk)
+{
+ lock_sock(sk);
+ inet6_sk(sk)->rxopt.bits.rxinfo = true;
+ release_sock(sk);
+}
+
#endif /* _NET_IPV6_H */