[haiku-development] Load/Unload of net_socket module

  • From: Romain <romain.haiku@xxxxxxxxxxx>
  • To: Haiku development <haiku-development@xxxxxxxxxxxxx>
  • Date: Sun, 12 Apr 2009 23:59:53 +0200

I am currently looking at a crash in the netstack that made me look at
calls done at boot time. I saw a few things but something seems really
strange to me. It seems that the net_socket module is not being loaded when
the stack is loaded, but when some specific calls are done
(get_domain_protocols, and get_domain_datalink protocols for example). On
the other way the net_stack_interface module is loaded when the first
interface is configured (create_interface). This can lead to situations
where the net_stack_interface module is loaded and calls to socket_open
happens although the net_socket module is not loaded. I have the following
boot traces after adding some dprintf: 

...
stack_interface init
net_socket init
register_domain(1, internet)
unregister_domain(0x8101c550, 1, internet)
net_socket uninit
net_socket init
net_socket uninit
net_socket init
register_domain(9, unix)
unregister_domain(0x8101c410, 9, unix)
net_socket uninit
stack_interface_open
socket_open => net_socket B_MODULE_INIT not called yet!
net_socket init => Seems to be triggered by get_domain_protocol call from
                   create_socket from socket_open call!
register_domain(1, internet)
...

I suppose that it is not normal that calls to a module are done before it
is loaded/initialized. However I am not sure whether this should be done
while loading the net_stack, or at another location. 

Romain.

Other related posts:

  • » [haiku-development] Load/Unload of net_socket module - Romain