tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: if_tun module doesn't autoload if opening /dev/tunN



On Wed, Sep 7, 2016 at 2:50 PM, Paul Goyette <paul%whooppee.com@localhost> wrote:
> 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?

Cannot we have an alias name for a device to use it for module_autoload?
I'm assuming cdevsw#d_mod_filename for example. It's simpler and explicit.

  ozaki-r


Home | Main Index | Thread Index | Old Index