[RFC PATCH bpf-next 12/14] bpf: Allow bpf_sock_(map|hash)_update from BPF_SOCK_OPS_UDP_CONNECTED_CB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Finally, enable the use of bpf_sock_map_update and bpf_sock_hash_update
from the BPF_SOCK_OPS_UDP_CONNECTED_CB sockops hook to allow automatic
management of the contents of a socket hash.

Signed-off-by: Jordan Rife <jordan@xxxxxxxx>
---
 net/core/sock_map.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/core/sock_map.c b/net/core/sock_map.c
index b0b428190561..08b6d647100c 100644
--- a/net/core/sock_map.c
+++ b/net/core/sock_map.c
@@ -522,7 +522,8 @@ static bool sock_map_op_okay(const struct bpf_sock_ops_kern *ops)
 {
 	return ops->op == BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB ||
 	       ops->op == BPF_SOCK_OPS_ACTIVE_ESTABLISHED_CB ||
-	       ops->op == BPF_SOCK_OPS_TCP_LISTEN_CB;
+	       ops->op == BPF_SOCK_OPS_TCP_LISTEN_CB ||
+	       ops->op == BPF_SOCK_OPS_UDP_CONNECTED_CB;
 }
 
 static bool sock_map_redirect_allowed(const struct sock *sk)
-- 
2.43.0





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux