From: Narendra K <Narendra_K@dell.com>
To: shemminger@linux-foundation.org
Cc: be-mail2009@lina.inka.de, jengelh@medozas.de,
net-tools@lina.inka.de, netfilter-devel@vger.kernel.org,
jgarzik@users.sourceforge.net, charles_rose@dell.com,
matt_domsch@dell.com, shyam_iyer@dell.com,
jordan_hargrave@dell.com, sandeep_k_shandilya@dell.com
Subject: Re:[PROPOSAL]: Alias names for network interfaces
Date: Tue, 12 Jan 2010 13:49:56 -0600 [thread overview]
Message-ID: <20100112194955.GA11752@mock.linuxdev.us.dell.com> (raw)
In-Reply-To: <EDA0A4495861324DA2618B4C45DCB3EE5899AC@blrx3m08.blr.amer.dell.com>
> > > > > ifconfig would show Embedded_NIC_N instead of ethN.
> > > >
> > > > Renaming away from ethN causes some applications like net-snmp to
> > get
> > > > confused,
> > > > and others have special sorting rules based on existing model
> (like
> > > > quagga).
> > > >
> > > > I would argue that the "ethN" convention is part of existing
> system
> > > > ABI and should not get changed in a visible way to applications.
> > >
> > > Stephen,
> > >
> > > Thanks. What are your views on the current proposal we are making
> > where
> > > ethN names are not changed (or renamed) and libnetdevname would
> > suggest
> > > alias names for the ethN names ( and also alias to ethN names) in
> > user
> > > space. Applications like ip, ethtool etc can use these aliases, make
> > > calls to libnetdevname and get the ethN name.
> > >
> > > Libnetdevname would read from sysfs the smbios names of the network
> > > interface devices as Jordan mentioned
> > > (/sys/class/net/ethX/device/smbiosname). Would this be acceptable ?
> >
> > I have no need or use for them, but if it doesn't break other things
> > then sure.
>
> Jeff / netfilter-devel,
>
> It would greatly help to know your views on this proposal.
The proposal is to enhance iptables (and other tools which might fail if
integrated port 1 does not get named as eth0) to support something like
iptables -A INPUT -i Embedded_NIC_1 -j ACCEPT
in addition to what it already supports
iptables -A INPUT -i eth0 -j ACCEPT.
Below is how the iptables code that handles the "-i ethN" would look
like (Only a part of the code to demonstrate the idea shown here) -
diff -Naru iptables-1.4.5/xtables.c iptables-1.4.5-new/xtables.c
--- iptables-1.4.5/xtables.c 2010-01-12 02:47:16.293249537 +0530
+++ iptables-1.4.5-new/xtables.c 2010-01-13 06:14:12.130185117 +0530
@@ -455,8 +455,8 @@
void xtables_parse_interface(const char *arg, char *vianame,
unsigned char *mask)
{
- int vialen = strlen(arg);
unsigned int i;
+ static char kernel_name[IFNAMSIZ];
memset(mask, 0, IFNAMSIZ);
memset(vianame, 0, IFNAMSIZ);
@@ -466,7 +466,11 @@
"interface name `%s' must be shorter than IFNAMSIZ"
" (%i)", arg, IFNAMSIZ-1);
- strcpy(vianame, arg);
+ if (netdev_alias_to_kernel_name(arg, kernel_name) < 0)
+ show_alias_name_usage();
+
+ strcpy(vianame, kernel_name);
+ int vialen = strlen(kernel_name);
if ((vialen == 0) || (vialen == 1 && vianame[0] == '+'))
memset(mask, 0, IFNAMSIZ);
else if (vianame[vialen - 1] == '+') {
where kernel_name is the ethN name that will be returned by a library
like libnetdevname which will map the user supplied "Embedded_NIC_1"
name to the corresponding ethN name, thus bringing in determinism while
referring to the network interfaces.
Netfilter-devel, would this be acceptable ?
With regards,
Narendra K
next parent reply other threads:[~2010-01-12 19:49 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <EDA0A4495861324DA2618B4C45DCB3EE5899AC@blrx3m08.blr.amer.dell.com>
2010-01-12 19:49 ` Narendra K [this message]
2010-01-13 0:11 ` Re:[PROPOSAL]: Alias names for network interfaces Jan Engelhardt
2010-01-13 6:47 ` [PROPOSAL]: " Narendra_K
2010-01-13 11:04 ` Bernd Eckenfels
2010-01-13 17:22 ` John Haxby
2010-01-13 17:46 ` Domsch, Matt
2010-01-13 18:11 ` Bernd Eckenfels
2010-01-13 18:21 ` Jan Engelhardt
2010-01-14 8:44 ` Patrick McHardy
2010-01-14 9:35 ` Jan Engelhardt
2010-01-15 19:14 ` Narendra_K
2010-01-18 17:07 ` Marco Innocenti
2010-01-19 17:32 ` Narendra_K
2010-01-19 22:31 ` Stephen Hemminger
2010-01-20 1:02 ` Bernd Eckenfels
2010-01-20 16:42 ` Narendra_K
2010-01-13 17:54 ` Stephen Hemminger
2010-01-13 13:24 ` Patrick McHardy
2010-01-13 13:43 ` Jan Engelhardt
2010-01-13 16:27 ` Stephen Hemminger
2010-01-13 17:00 ` Narendra_K
2010-01-14 8:41 ` Patrick McHardy
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100112194955.GA11752@mock.linuxdev.us.dell.com \
--to=narendra_k@dell.com \
--cc=be-mail2009@lina.inka.de \
--cc=charles_rose@dell.com \
--cc=jengelh@medozas.de \
--cc=jgarzik@users.sourceforge.net \
--cc=jordan_hargrave@dell.com \
--cc=matt_domsch@dell.com \
--cc=net-tools@lina.inka.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=sandeep_k_shandilya@dell.com \
--cc=shemminger@linux-foundation.org \
--cc=shyam_iyer@dell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.