Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752408Ab1BEO71 (ORCPT ); Sat, 5 Feb 2011 09:59:27 -0500 Received: from mail-iy0-f174.google.com ([209.85.210.174]:45557 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751484Ab1BEO7Z convert rfc822-to-8bit (ORCPT ); Sat, 5 Feb 2011 09:59:25 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=LmcJA271fR5zzR1Mb9EkI244a0Vd030lyAKvgoFn/LX9HBeI/ofhj6Su/9dJd+Xy4k SFB/mv1eFurtRZTlwQ5C2pWGArinp85qB/4b+s489A7FZNtnSQBtqSB7Et5ZJqVQqSDQ JN33pGG5MWLnzTNnTCnkC2Z0ZQrCIRfbmBzjA= MIME-Version: 1.0 In-Reply-To: <20110205142648.GA9814@p183.telecom.by> References: <20110205142648.GA9814@p183.telecom.by> From: Lucian Adrian Grijincu Date: Sat, 5 Feb 2011 16:59:04 +0200 Message-ID: Subject: Re: [PATCH 0/5] net: sysctl: share ipv4/ipv6 sysctl tables To: Alexey Dobriyan Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, "Eric W. Biederman" , Eric Dumazet , "David S. Miller" , Octavian Purdila Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 902 Lines: 28 On Sat, Feb 5, 2011 at 4:26 PM, Alexey Dobriyan 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/