[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110115104139.GA4816@p183.telecom.by>
Date: Sat, 15 Jan 2011 12:41:39 +0200
From: Alexey Dobriyan <adobriyan@...il.com>
To: Lucian Adrian Grijincu <lucian.grijincu@...il.com>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
Alexey Kuznetsov <kuznet@....inr.ac.ru>,
"Pekka Savola (ipv6)" <pekkas@...core.fi>,
James Morris <jmorris@...ei.org>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
Patrick McHardy <kaber@...sh.net>,
Nick Piggin <npiggin@...nel.dk>,
Al Viro <viro@...iv.linux.org.uk>,
Christoph Hellwig <hch@....de>,
Dave Chinner <dchinner@...hat.com>,
Neil Horman <nhorman@...driver.com>,
Eric Dumazet <eric.dumazet@...il.com>,
Octavian Purdila <opurdila@...acom.com>,
Vlad Dogaru <ddvlad@...edu.org>
Subject: Re: [PATCH] RFC: ipv4: share sysctl net/ipv4/conf/DEVNAME/ tables
On Sat, Jan 15, 2011 at 04:46:11AM +0200, Lucian Adrian Grijincu wrote:
> To gain access to the name of the directory above a file, sysctl
> handlers are passed an extra argument: the 'struct file*'
> corresponding to the file. From the file we walk up one level to find
> the name of the device. None of the other handlers were changed to
> receive this extra parameter, but due to C's calling convention they
> shouldn't care.
We don't do creepy stuff like that.
I wonder where interactions with device renaming are handled.
> +static int devinet_conf_handler(ctl_table *ctl, int write,
> + void __user *buffer,
> + size_t *lenp, loff_t *ppos,
> + struct file *filp,
> + proc_handler *proc_handler)
> +{
> + /* The path to this file is of the form /proc/sys/net/ipv4/conf/$DEVNAME/$CTL
> + *
> + * To save space, ctl_table is shared between all network
> + * devices in the same network namespace, but we need to
> + * change the data corresponding to the $DEVNAME network
> + * device, not any other's.
> + *
> + * Use $DEVNAME to obtain the coresponding ipv4_devconf.
> + */
> + struct net *net = ctl->extra2;
> + const char *dev_name = filp->f_path.dentry->d_parent->d_name.name;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists