I try to create an entry inside /proc/net from a kernel module, like this:

struct file *filp = filp_open("/proc/net", O_RDONLY, 0);
struct proc_dir_entry *parent = PDE(filp->f_dentry->d_inode);
filp_close(filp, NULL);

proc_file = create_proc_entry("test", 0644, parent);
Crudely taken from here: linuxquestions.org/questions/linux-kernel-70/create_proc_entry-path-help-894814/

Why does it create my entry like /proc/test instead of /proc/net/test?

(Note: I'd like too use create_proc_entry, not proc_create.)

[This Q on StackOverflow: stackoverflow.com/questions/16720168/create-procfs-entry-in-proc-net]
Feel free to put your answer on SO too, for the rep.


I need to be honest, I'm a this-time-only kernel dev, so I won't be able to give back the help to the community. So you decide if I'm worth helping. Thanks, anyway.