| To: | davem@xxxxxxxxxx |
|---|---|
| Subject: | [PATCH] trivial patch for if_indextoname() |
| From: | David Stevens <dlstevens@xxxxxxxxxx> |
| Date: | Wed, 26 May 2004 16:15:07 -0600 |
| Cc: | netdev@xxxxxxxxxxx |
| Sender: | netdev-bounce@xxxxxxxxxxx |
RFC3493 (section 4.2) specifies that an invalid interface name
passed to if_indextoname() should return NULL with errno of ENXIO.
The current code sets errno to ENODEV for this case.
This could be remapped in glibc, but since the comment for
kernel function dev_ifname() says it's specifically for
if_indextoname(), maybe it should be fixed here.
+-DLS
--- net/core/dev.c.orig 2004-05-09 19:32:37.000000000 -0700
+++ net/core/dev.c 2004-05-26 14:54:37.378210416 -0700
@@ -1927,7 +1927,7 @@
dev = __dev_get_by_index(ifr.ifr_ifindex);
if (!dev) {
read_unlock(&dev_base_lock);
- return -ENODEV;
+ return -ENXIO;
}
strcpy(ifr.ifr_name, dev->name);
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Patch: b44.c: Always restore pci config on resume, Stefan Rompf |
|---|---|
| Next by Date: | Re: [PATCH 0/5] 2.4.27-pre3 pcnet32.c, Don Fry |
| Previous by Thread: | Patch: b44.c: Always restore pci config on resume, Stefan Rompf |
| Next by Thread: | Re: [PATCH] trivial patch for if_indextoname(), David S. Miller |
| Indexes: | [Date] [Thread] [Top] [All Lists] |