mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* sysctl and more SIOCSIFNAME (net device rename) inconsistencies
@ 2003-06-29 18:36 Dan Aloni
  0 siblings, 0 replies; only message in thread
From: Dan Aloni @ 2003-06-29 18:36 UTC (permalink / raw)
  To: Rusty Russell; +Cc: Linux Kernel Mailing List, Greg KH

The day before yesterday I found that renaming a network 
device under 2.5 doesn't update sysfs. While trying to 
figure this out I've found that there's another stuff that 
don't get updated with the new name: sysctl.

My system renames one of my cards to ethlan on boot. Later I 
manually renamed it to another name. Here are the 3 different names 
that the kernel see for the same network device.

ifconfig, sees the right name (ethlanX):

    [root@callisto ~]# ifconfig ethlanX
    ethlanX   Link encap:Ethernet  HWaddr 00:80:AD:00:DB:BC  
              inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
              BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:2225 errors:0 dropped:0 overruns:0 frame:0
              TX packets:2984 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:100 
              RX bytes:472674 (461.5 KiB)  TX bytes:2466241 (2.3 MiB)
              Interrupt:5 Base address:0xb000 

sysfs, sees the name of the device at module load time (eth0 or eth1):

    [root@callisto ~]# ls -l /sys/class/net
    total 0
    drwxr-xr-x    3 root     root            0 Jun 29 20:41 eth0
    drwxr-xr-x    3 root     root            0 Jun 29 20:41 eth1
    drwxr-xr-x    3 root     root            0 Jun 29 20:41 lo
    drwxr-xr-x    3 root     root            0 Jun 29 20:41 ppp0

sysctl, sees the name of the device at some point in time
when the directory was instantiated by the user (ethlan):

    [root@callisto ~]# ls -l /proc/sys/net/ipv4/conf  
    total 0
    dr-xr-xr-x    2 root     root            0 Jun 29 21:20 all
    dr-xr-xr-x    2 root     root            0 Jun 29 21:20 default
    dr-xr-xr-x    2 root     root            0 Jun 29 21:20 ethinet
    dr-xr-xr-x    2 root     root            0 Jun 29 21:20 ethlan
    dr-xr-xr-x    2 root     root            0 Jun 29 21:20 lo
    dr-xr-xr-x    2 root     root            0 Jun 29 21:20 ppp0

Note that this is also affects sysctl(2), as it uses /proc:

    [root@callisto /home/karrde]# sysctl -a | grep ethlan.tag
    net.ipv4.conf.ethlan.tag = 0

I think this should be fixed before 2.6. I'm starting to figure out
about sysfs, but I have no idea how to fix the sysctl part at the 
moment.

-- 
Dan Aloni
da-x@gmx.net

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-06-29 18:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-29 18:36 sysctl and more SIOCSIFNAME (net device rename) inconsistencies Dan Aloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®