diff options
author | Rémi Denis-Courmont <remi.denis-courmont@nokia.com> | 2009-07-20 21:57:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-23 20:58:19 -0400 |
commit | c1dc13e9d0bc35a8d85bf4238c48c1b627d48f35 (patch) | |
tree | 7bc3ecf8a72b1dc940f6cd676eb9bcfebfc2402e /net/phonet/pn_dev.c | |
parent | e8834a63bddf87f7b85955d1ba60d28343d88469 (diff) |
Phonet: sockets list through proc_fs
This provides a list of sockets with their Phonet bind addresses and
some socket debug informations through /proc/net/phonet.
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/phonet/pn_dev.c')
-rw-r--r-- | net/phonet/pn_dev.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c index b0d6ddd82a9d..5107b7949c9c 100644 --- a/net/phonet/pn_dev.c +++ b/net/phonet/pn_dev.c | |||
@@ -218,6 +218,11 @@ static int phonet_init_net(struct net *net) | |||
218 | if (!pnn) | 218 | if (!pnn) |
219 | return -ENOMEM; | 219 | return -ENOMEM; |
220 | 220 | ||
221 | if (!proc_net_fops_create(net, "phonet", 0, &pn_sock_seq_fops)) { | ||
222 | kfree(pnn); | ||
223 | return -ENOMEM; | ||
224 | } | ||
225 | |||
221 | INIT_LIST_HEAD(&pnn->pndevs.list); | 226 | INIT_LIST_HEAD(&pnn->pndevs.list); |
222 | spin_lock_init(&pnn->pndevs.lock); | 227 | spin_lock_init(&pnn->pndevs.lock); |
223 | net_assign_generic(net, phonet_net_id, pnn); | 228 | net_assign_generic(net, phonet_net_id, pnn); |
@@ -233,6 +238,8 @@ static void phonet_exit_net(struct net *net) | |||
233 | for_each_netdev(net, dev) | 238 | for_each_netdev(net, dev) |
234 | phonet_device_destroy(dev); | 239 | phonet_device_destroy(dev); |
235 | rtnl_unlock(); | 240 | rtnl_unlock(); |
241 | |||
242 | proc_net_remove(net, "phonet"); | ||
236 | kfree(pnn); | 243 | kfree(pnn); |
237 | } | 244 | } |
238 | 245 | ||