Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Jul 2009 12:31:53 -0700
From:      "Matthew Fleming" <matthew.fleming@isilon.com>
To:        <freebsd-stable@freebsd.org>
Subject:   Loading ng_socket at runtime?
Message-ID:  <06D5F9F6F655AD4C92E28B662F7F853E02F6F4BC@seaxch09.desktop.isilon.com>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?06D5F9F6F655AD4C92E28B662F7F853E02F6F4BC>