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
On Thu, 30 Jul 2009, Matthew Fleming wrote:> 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 anywaysI go for option 1 on -current with bluetooth and it seems to work.. I suspect the comments don't match reality any more. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: This is a digitally signed message part. Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20090730/b54d0082/attachment.pgp
On Wed, 29 Jul 2009, Matthew Fleming wrote:> 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()I've wondered about these warnings also, and am not sure they're justified -- any protocol loading after domainfinalize() should expect that timers are already started, etc, and loadable protocols are clearly desirable.> - ignore the warning (usually a bad idea...)Probably remove the warning. Some more synchronization is likely required in domain registration than is currently there -- on the other hand, it's probably not a big issue that it's missing as write operations on the domain list are conservative and extremely rare. I've CC'd Max Laier, who added the warnings -- perhaps he could lend some insight into the types of problems he anticipated. The main one I'm aware of is that mutating the domain list on a live system is risky because it's not well-synchronized -- however, adding domains should be pretty safe in practice. Robert