Loading ng_socket at runtime?

Matthew Fleming matthew.fleming at isilon.com
Wed Jul 29 19:44:20 UTC 2009


I'm doing a migration from releng/6.1 to stable/7, and one of the many
new things is that I get a warning when doing things with ng_socket that
didn't used to happen.

WARNING: attempt to net_add_domain(netgraph) after domainfinalize()

The MOD_LOAD code in ng_socket.c is doing a net_add_domain in both 6.1
and stable/7.  I see that r138239 has added some state in uipc_domain.c
that assumes that all domains are added during system initialization.
And it looks like the system isn't really expecting any added later,
given the comments.

What I don't quite get is,
(1) this worked without warnings on 6.1, though that could be for any
number of reasons
(2) why does e.g. usr.sbin/ppp have code to load it at runtime in
several places if it's not supported?

./usr.sbin/ppp/ether.c:    loadmodules(LOAD_VERBOSLY, "netgraph",
"ng_ether", "ng_pppoe", "ng_socket",
./usr.sbin/ppp/tty.c:  loadmodules(LOAD_VERBOSLY, "netgraph", "ng_tty",
"ng_async", "ng_socket",
./usr.sbin/ppp/netgraph.c:    loadmodules(LOAD_VERBOSLY, "netgraph",
"ng_socket", NULL);

So, what's the right thing to do?

 - ignore the warning (usually a bad idea...)
 - load ng_socket on boot
 - compile ng_socket.c into the kernel since it would be loaded on boot
anyways

Thanks!
matthew


More information about the freebsd-stable mailing list