LKML Archive on
help / color / mirror / Atom feed
From: "Kyle Moffett" <>
To: "Eric W. Biederman" <>
Cc: "Stephen Hemminger" <>,
	"Serge E. Hallyn" <>,
	"Benjamin Thery" <>,
	netdev <>,
	"Dave Miller" <>,
	"Greg Kroah-Hartman" <>,
	"Al Viro" <>,
	"Daniel Lezcano" <>,, "Tejun Heo" <>,
	"Denis Lunev" <>,
	"Linux Containers" <>
Subject: Re: [PATCH 0/4][RFC] netns: sysfs: add a netns suffix to net device sysfs entries
Date: Thu, 23 Oct 2008 00:14:19 -0400	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Wed, Oct 22, 2008 at 6:54 PM, Eric W. Biederman
<> wrote:
> Stephen Hemminger <> writes:
>>> The well-known user space tools don't use /sys at all.  Modern
>>> network tools use rtnetlink (ip) old network tools use /proc/net.
>>> Very few things actually use /sys and for those things lo@1 or
>>> eth0@1 are completely useless except for implementing a FUSE
>>> mock up of sysfs.  But you don't need anything in sysfs to do
>>> that as all of the interesting information is available through
>>> /proc/net or rtnetlink.
>> Lots of scripts are starting use /sys for things. It is easier to
>> parse /sys/class/net than the output of ifconfig or ip
> Yes.  So we need the correct values in /sys/class/net.
> Which is why sysfs and network namespaces do not coexist currently.

I definitely agree that "eth0@1" is a bad ide. I know for sure that a
relatively large number of system init scripts poke about in
/sys/class/net/$IFACE, as well as a number of the system installation
scripts.  Those scripts include some that my company has written for
internal use and others supplied by distributions.

Daemons and such mostly use netlink, but for anything written in shell
it's much easier to do things like this:

for devpath in /sys/class/net/*; do
    case "${dev}" in
    if [ "x${mac}" = "x$(cat ${devpath}/address)" ]; then
        echo "Found MAC '${mac}': ${dev}"

If I wanted to perform similar things with the output of ifconfig, it
would involve some much more fragile manual text parsing of the output
of the "ip" or "ifconfig" commands.  And sometimes the "ifconfig"
command is outright wrong.  If you have an interface name longer than
7 characters or so then some versions of ifconfig will truncate it
internally and display garbage.

While the "show only the root namespace" interim solution is
problematic for processes in network namespaces, I think it's more
important not to break things for admin tools in the root namespace.

Kyle Moffett

  reply	other threads:[~2008-10-23  4:14 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-22 15:21 Benjamin Thery
2008-10-22 15:21 ` [PATCH 1/4] netns: add in ida ID to identify the network namespace Benjamin Thery
2008-10-22 15:22 ` [PATCH 2/4] netns: Export nets id to /proc/net/netns Benjamin Thery
2008-10-22 15:22 ` [PATCH 3/4] net: cleanup some vars names to be more consistant with the network code Benjamin Thery
2008-10-22 15:22 ` [PATCH 4/4] netns: sysfs: add netns suffix to net devices sysfs entries Benjamin Thery
2008-10-22 19:59 ` [PATCH 0/4][RFC] netns: sysfs: add a netns suffix to net device " Eric W. Biederman
2008-10-22 20:30   ` Serge E. Hallyn
2008-10-22 21:01     ` Eric W. Biederman
2008-10-22 21:55       ` Stephen Hemminger
2008-10-22 22:54         ` Eric W. Biederman
2008-10-23  4:14           ` Kyle Moffett [this message]
2008-10-23 11:56   ` Benjamin Thery
2008-10-23 15:46     ` Eric W. Biederman
2008-10-22 20:16 ` Greg KH
2008-10-22 21:08   ` Eric W. Biederman
2008-10-22 21:24     ` Greg KH
2008-10-22 20:32 ` [PATCH] netns: Coexist with the sysfs limitations Eric W. Biederman
2008-10-22 20:40   ` Daniel Lezcano
2008-10-22 21:21   ` Serge E. Hallyn
2008-10-23  8:04     ` Benjamin Thery
2008-10-23 15:40       ` Eric W. Biederman
2008-10-23 15:56       ` [PATCH] netns: Coexist with the sysfs limitations v2 Eric W. Biederman
2008-10-27 19:41         ` David Miller
2008-10-27 20:19           ` Eric W. Biederman
2008-10-28  0:50             ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH 0/4][RFC] netns: sysfs: add a netns suffix to net device sysfs entries' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).