Re: panic after dhclient in sys/net/if.c mtx_lock

From: Norikatsu Shigemura <nork_at_FreeBSD.org>
Date: Sun, 17 May 2009 21:16:35 +0900
Hi.

On Sun, 17 May 2009 20:00:19 +0900
Norikatsu Shigemura <nork_at_FreeBSD.org> wrote:
>     ta_context = 0x0}, if_addr_mtx = {lock_object = {lo_name = 0x0, lo_flags = 0, 
>       lo_data = 0, lo_witness = 0x0}, mtx_lock = 0}, if_clones = {le_next = 0x0, 

	In this time, if_addr_mtx doesn't initilized.

	According to /usr/src/sys/netinet/in.c:921 (UP#14), ifp = &info,
	So I read:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        /*
         * add a loopback route to self
         */
        if (!(ifp->if_flags & (IFF_LOOPBACK | IFF_POINTOPOINT))) {
                bzero(&info, sizeof(info));
                info.rti_ifp = V_loif;
                info.rti_flags = ia->ia_flags | RTF_HOST | RTF_STATIC;
                info.rti_info[RTAX_DST] = (struct sockaddr *)&ia->ia_addr;
                info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl;
                error = rtrequest1_fib(RTM_ADD, &info, &rt, 0);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	info.rti_ifp == V_loif (=vnet_net_0._loif), but different:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(kgdb) p info.rti_ifp
$16 = (struct ifnet *) 0xffffff00050caa00
(kgdb) p vnet_net_0._loif
$17 = (struct ifnet *) 0xffffff0005172000
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

	Of cource, V_loif->if_addr_mtx is initialized.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(kgdb) p vnet_net_0._loif->if_addr_mtx
$18 = {lock_object = {lo_name = 0xffffffff80576ca1 "if_addr_mtx", lo_flags = 16973824, 
    lo_data = 0, lo_witness = 0x0}, mtx_lock = 4}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

	Hum.....
Received on Sun May 17 2009 - 10:16:41 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:47 UTC