Messages in this thread | | | From | Lucian Adrian Grijincu <> | Date | Sat, 5 Feb 2011 16:59:04 +0200 | Subject | Re: [PATCH 0/5] net: sysctl: share ipv4/ipv6 sysctl tables |
| |
On Sat, Feb 5, 2011 at 4:26 PM, Alexey Dobriyan <adobriyan@gmail.com> wrote: >> I'm not sure what I have to do to pass the name of a device (e.g. >> "eth0") instead of "default" but at least "default" and "all" work and >> have valid dentries. > > You do ->parent->procname. > > But, but you removed parent.
To be more exact I do: const char *dev_name = filp->f_path.dentry->d_parent->d_name.name;
If the sysctl table is shared between all network devices, the last registered node will set the ->parent.
So accessing /proc/sys/net/ipv4/conf/$DEVNAME/$CTL will access $CTL for the last network device registered not for $DEVNAME.
-- . ..: Lucian -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |