summaryrefslogtreecommitdiff
path: root/net/rxrpc/net_ns.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2022-05-21 08:45:15 +0100
committerDavid S. Miller <davem@davemloft.net>2022-05-22 21:03:01 +0100
commit33912c2639ad76660988c8ca97e4d18fca89b668 (patch)
tree92c5f3666a6efccdcdfac23499bf293547e5724b /net/rxrpc/net_ns.c
parent0598cec957abbdd47b8eb7dceb51d54ac465417d (diff)
downloadlwn-33912c2639ad76660988c8ca97e4d18fca89b668.tar.gz
lwn-33912c2639ad76660988c8ca97e4d18fca89b668.zip
rxrpc: Allow list of in-use local UDP endpoints to be viewed in /proc
Allow the list of in-use local UDP endpoints in the current network namespace to be viewed in /proc. To aid with this, the endpoint list is converted to an hlist and RCU-safe manipulation is used so that the list can be read with only the RCU read lock held. Signed-off-by: David Howells <dhowells@redhat.com> cc: Marc Dionne <marc.dionne@auristor.com> cc: linux-afs@lists.infradead.org Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rxrpc/net_ns.c')
-rw-r--r--net/rxrpc/net_ns.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/rxrpc/net_ns.c b/net/rxrpc/net_ns.c
index cc7e30733feb..34f389975a7d 100644
--- a/net/rxrpc/net_ns.c
+++ b/net/rxrpc/net_ns.c
@@ -72,7 +72,7 @@ static __net_init int rxrpc_init_net(struct net *net)
timer_setup(&rxnet->client_conn_reap_timer,
rxrpc_client_conn_reap_timeout, 0);
- INIT_LIST_HEAD(&rxnet->local_endpoints);
+ INIT_HLIST_HEAD(&rxnet->local_endpoints);
mutex_init(&rxnet->local_mutex);
hash_init(rxnet->peer_hash);
@@ -98,6 +98,9 @@ static __net_init int rxrpc_init_net(struct net *net)
proc_create_net("peers", 0444, rxnet->proc_net,
&rxrpc_peer_seq_ops,
sizeof(struct seq_net_private));
+ proc_create_net("locals", 0444, rxnet->proc_net,
+ &rxrpc_local_seq_ops,
+ sizeof(struct seq_net_private));
return 0;
err_proc: