Hi,
Loading tun.ko module breaks on sysfs...
> [root@localhost misc]# pwd
> /sys/class/misc
> [root@localhost misc]# ls
> dac960_gam device-mapper net/tun psaux
> [root@localhost misc]# cd net\/tun
> bash: cd: net/tun: No such file or directory
> [root@localhost misc]#
Why not just make it in misc? why net/tun seeing as everything else is
just dumped there. Patch below.
--- drivers/net/tun.c.old 2004-02-27 18:18:55.000000000 +0200
+++ drivers/net/tun.c 2004-02-27 18:19:02.000000000 +0200
@@ -605,7 +605,7 @@
static struct miscdevice tun_miscdev = {
.minor = TUN_MINOR,
- .name = "net/tun",
+ .name = "tun",
.fops = &tun_fops
};
Nigel Kukard wrote:
> --- drivers/net/tun.c.old 2004-02-27 18:18:55.000000000 +0200
> +++ drivers/net/tun.c 2004-02-27 18:19:02.000000000 +0200
> @@ -605,7 +605,7 @@
>
> static struct miscdevice tun_miscdev = {
> .minor = TUN_MINOR,
> - .name = "net/tun",
> + .name = "tun",
> .fops = &tun_fops
> };
This changed back and forth since the tun driver was added to the
kernel; making this change will cause the devfs path to the tun node to
change, and userspace applications expect it to be at /dev/misc/net/tun,
whether that's right or wrong.
Nevermind if its right or wrong, it does not work in sysfs
-Nigel
On Mon, Mar 01, 2004 at 01:20:19PM -0700, Kevin P. Fleming wrote:
> Nigel Kukard wrote:
>
> >--- drivers/net/tun.c.old 2004-02-27 18:18:55.000000000 +0200
> >+++ drivers/net/tun.c 2004-02-27 18:19:02.000000000 +0200
> >@@ -605,7 +605,7 @@
> >
> > static struct miscdevice tun_miscdev = {
> > .minor = TUN_MINOR,
> >- .name = "net/tun",
> >+ .name = "tun",
> > .fops = &tun_fops
> > };
>
> This changed back and forth since the tun driver was added to the
> kernel; making this change will cause the devfs path to the tun node to
> change, and userspace applications expect it to be at /dev/misc/net/tun,
> whether that's right or wrong.
* Kevin P. Fleming ([email protected]) wrote:
> Nigel Kukard wrote:
>
> > --- drivers/net/tun.c.old 2004-02-27 18:18:55.000000000 +0200
> > +++ drivers/net/tun.c 2004-02-27 18:19:02.000000000 +0200
> > @@ -605,7 +605,7 @@
> >
> > static struct miscdevice tun_miscdev = {
> > .minor = TUN_MINOR,
> > - .name = "net/tun",
> > + .name = "tun",
> > .fops = &tun_fops
> > };
>
> This changed back and forth since the tun driver was added to the
> kernel; making this change will cause the devfs path to the tun node to
> change, and userspace applications expect it to be at /dev/misc/net/tun,
> whether that's right or wrong.
Why don't you use:
.devfs_name = "net/tun",
Or fix userspace apps? Or switch to udev with devfs rules emulated and a
rule for the tun/tap driver?
thanks,
-chris
--
Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net
Chris Wright wrote:
> Why don't you use:
> .devfs_name = "net/tun",
That seems fine, if it will do the job.
> Or fix userspace apps? Or switch to udev with devfs rules emulated and a
> rule for the tun/tap driver?
This is a stable kernel series; these kinds of userspace-breakage
changes are not supposed to happen. Personally I have already started
migrating my systems to udev, but it will take some time to complete
that. Regardless, this would be a userspace-incompatible change if using
.devfs_name won't do the job.
Followup to: <[email protected]>
By author: "Kevin P. Fleming" <[email protected]>
In newsgroup: linux.dev.kernel
>
> Nigel Kukard wrote:
>
> > --- drivers/net/tun.c.old 2004-02-27 18:18:55.000000000 +0200
> > +++ drivers/net/tun.c 2004-02-27 18:19:02.000000000 +0200
> > @@ -605,7 +605,7 @@
> >
> > static struct miscdevice tun_miscdev = {
> > .minor = TUN_MINOR,
> > - .name = "net/tun",
> > + .name = "tun",
> > .fops = &tun_fops
> > };
>
> This changed back and forth since the tun driver was added to the
> kernel; making this change will cause the devfs path to the tun node to
> change, and userspace applications expect it to be at /dev/misc/net/tun,
> whether that's right or wrong.
>
Bullsh*t.
User-space apps expect it to be /dev/net/tun, which is the documented
path for this device node. Anything else is a devfs bug (/dev/misc is
a devfs bug from beginning to end.)
-hpa
Nothing said solves the problem, the problem has got nothing to do with
devfs (only for compat reasons), the problem is that "net/tun" breaks
sysfs.
-Nigel
On Mon, Mar 01, 2004 at 01:20:19PM -0700, Kevin P. Fleming wrote:
> Nigel Kukard wrote:
>
> >--- drivers/net/tun.c.old 2004-02-27 18:18:55.000000000 +0200
> >+++ drivers/net/tun.c 2004-02-27 18:19:02.000000000 +0200
> >@@ -605,7 +605,7 @@
> >
> > static struct miscdevice tun_miscdev = {
> > .minor = TUN_MINOR,
> >- .name = "net/tun",
> >+ .name = "tun",
> > .fops = &tun_fops
> > };
>
> This changed back and forth since the tun driver was added to the
> kernel; making this change will cause the devfs path to the tun node to
> change, and userspace applications expect it to be at /dev/misc/net/tun,
> whether that's right or wrong.
* Nigel Kukard ([email protected]) wrote:
>
> Nothing said solves the problem, the problem has got nothing to do with
> devfs (only for compat reasons), the problem is that "net/tun" breaks
> sysfs.
Yes, why does this not work? Keeps devfs legacy name, works fine with
udev, and makes proper dir in sysfs.
thanks,
-chris
===== drivers/net/tun.c 1.29 vs edited =====
--- 1.29/drivers/net/tun.c Sat Jan 10 16:09:09 2004
+++ edited/drivers/net/tun.c Tue Mar 2 12:05:30 2004
@@ -602,7 +602,8 @@
static struct miscdevice tun_miscdev = {
.minor = TUN_MINOR,
- .name = "net/tun",
+ .name = "tun",
+ .devfs_name = "net/tun",
.fops = &tun_fops
};
Thanks bud!
Hopefully it'll get included in 2.6.4 ;)
On Tue, Mar 02, 2004 at 06:28:34PM -0800, Chris Wright wrote:
> * Nigel Kukard ([email protected]) wrote:
> >
> > Nothing said solves the problem, the problem has got nothing to do with
> > devfs (only for compat reasons), the problem is that "net/tun" breaks
> > sysfs.
>
> Yes, why does this not work? Keeps devfs legacy name, works fine with
> udev, and makes proper dir in sysfs.
>
> thanks,
> -chris
>
> ===== drivers/net/tun.c 1.29 vs edited =====
> --- 1.29/drivers/net/tun.c Sat Jan 10 16:09:09 2004
> +++ edited/drivers/net/tun.c Tue Mar 2 12:05:30 2004
> @@ -602,7 +602,8 @@
>
> static struct miscdevice tun_miscdev = {
> .minor = TUN_MINOR,
> - .name = "net/tun",
> + .name = "tun",
> + .devfs_name = "net/tun",
> .fops = &tun_fops
> };
>