We must remove the /proc/net/batgat/clients file and /proc/net/batgat dir correctly or otherwise we will get a oops when someone tries to access the file. If we do not remove the directory it is possible that more then one batgat entry appears inside of /proc/net/
Signed-off-by: Sven Eckelmann sven.eckelmann@gmx.de --- batman/linux/modules/gateway.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/batman/linux/modules/gateway.c b/batman/linux/modules/gateway.c index e90be0b..d7af197 100644 --- a/batman/linux/modules/gateway.c +++ b/batman/linux/modules/gateway.c @@ -769,8 +769,16 @@ int choose_vip(void *data, int32_t size)
static void cleanup_procfs(void) { - if(clients_file) remove_proc_entry("PROC_FILE_CLIENTS", proc_dir); - if(proc_dir) remove_proc_entry(PROC_ROOT_DIR, NULL); + if (clients_file) + remove_proc_entry(PROC_FILE_CLIENTS, proc_dir); + +#ifdef __NET_NET_NAMESPACE_H + if (proc_dir) + remove_proc_entry(PROC_ROOT_DIR, init_net.proc_net); +#else + if (proc_dir) + remove_proc_entry(PROC_ROOT_DIR, proc_net); +#endif }
static int setup_procfs(void)
On Thursday, 11. September 2008 21:53:27 Sven Eckelmann wrote:
We must remove the /proc/net/batgat/clients file and /proc/net/batgat dir correctly or otherwise we will get a oops when someone tries to access the file. If we do not remove the directory it is possible that more then one batgat entry appears inside of /proc/net/
Your patches look very good. Nice catch ! Simon already applied them.
Thanks, Marek
b.a.t.m.a.n@lists.open-mesh.org