tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
if_tun module doesn't autoload if opening /dev/tunN
According to the tun(4) man page, you can create an interface "by using
the ifconfig(8) create command" and this works just fine. The man page
goes on to say "An open() call on /dev/tunN, will also create a network
interface..." but this does not work.
I think this is because the code in sys/miscfs/specfs/spec_vnops.c
assumes that the module name is the same as the device name, ie it
expects that /dev/tunN will be handled by module tun.kmod However, the
module is actually named if_tun.kmod so it never gets loaded, and the
open() fails.
I can see a couple of ways to "fix" this:
1. Rename the module (with all appropriate updates to the
sets lists in src/distrib/sets/lists), or
2. Add code to spec_vnops.c to try loading module if_xxx if the
autoload of module xxx fails.
Comments? Preferences? Any other options I haven't yet seen?
+------------------+--------------------------+------------------------+
| Paul Goyette | PGP Key fingerprint: | E-mail addresses: |
| (Retired) | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org |
+------------------+--------------------------+------------------------+
Home |
Main Index |
Thread Index |
Old Index