utput.c:424
=     Variable: id =3D {0x023ab6e6}, name =3D "zone", = type =3D "u_int32_t", valid ranges =3D <block>, location =3D = DW_OP_fbreg -188, decl =3D ip6_output.c:425
=     Variable: id =3D {0x023ab726}, name =3D "error", = type =3D "int", valid ranges =3D <block>, location =3D = [0xffffffff80d8214f, 0xffffffff80d8251a) -> DW_OP_consts +0, = DW_OP_stack_value, decl =3D ip6_output.c:417
=     Variable: id =3D {0x023ab736}, name =3D = "vlan_pcp", type =3D "int", valid ranges =3D <block>, location =3D = [0xffffffff80d819c2, 0xffffffff80d82a18) -> DW_OP_breg6 RBP-96, decl = =3D ip6_output.c:418
    Variable: id = =3D {0x023ab746}, name =3D "ia", type =3D "in6_ifaddr *", valid ranges =3D= <block>, location =3D [0xffffffff80d82187, 0xffffffff80d82a18) = -> DW_OP_breg6 RBP-264, decl =3D ip6_output.c:419
=     Variable: id =3D {0x023ab776}, name =3D "ip6", = type =3D "ip6_hdr *", valid ranges =3D <block>, location =3D = [0xffffffff80d81e29, 0xffffffff80d82665) -> DW_OP_breg6 RBP-168, decl = =3D ip6_output.c:407
    Variable: id = =3D {0x023ab7c6}, name =3D "nexthdrp", type =3D "u_char *", valid ranges = =3D <block>, location =3D [0xffffffff80d81a4f, 0xffffffff80d82a18) = -> DW_OP_breg6 RBP-136, decl =3D ip6_output.c:415
=     Variable: id =3D {0x023ab7d6}, name =3D = "ro_pmtu", type =3D "route_in6 *", valid ranges =3D <block>, = location =3D [0xffffffff80d81ab4, 0xffffffff80d824c0) -> DW_OP_reg3 = RBX, decl =3D ip6_output.c:411
=     Variable: id =3D {0x023ab7e6}, name =3D "dst", = type =3D "sockaddr_in6 *", valid ranges =3D <block>, location =3D = [0xffffffff80d81b39, 0xffffffff80d82466) -> DW_OP_breg6 RBP-88, decl = =3D ip6_output.c:413
    Variable: id = =3D {0x023ab7f6}, name =3D "fibnum", type =3D "uint32_t", valid ranges =3D= <block>, location =3D [0xffffffff80d81b26, 0xffffffff80d827e3) = -> DW_OP_breg6 RBP-72, decl =3D ip6_output.c:429
=     Variable: id =3D {0x023ab806}, name =3D = "origifp", type =3D "ifnet *", valid ranges =3D <block>, location = =3D [0xffffffff80d8218b, 0xffffffff80d824ae) -> DW_OP_reg12 R12, decl = =3D ip6_output.c:408
    Variable: id = =3D {0x023ab876}, name =3D "tlen", type =3D "int", valid ranges =3D = <block>, location =3D <empty>, decl =3D ip6_output.c:416
    Variable: id =3D {0x023ab882}, name = =3D "dontfrag", type =3D "int", valid ranges =3D <block>, location = =3D <empty>, decl =3D ip6_output.c:421


   806 =         KASSERT((ifp !=3D NULL), = ("output interface must not be NULL"));
=    807 =         KASSERT((origifp !=3D = NULL), ("output address interface must not be NULL"));
=    808
   809 =         if ((flags & = IPV6_FORWARDING) =3D=3D 0) {
   810 =             &n= bsp;   /* XXX: the FORWARDING flag can be set for = mrouting. */
   811 =             &n= bsp;   in6_ifstat_inc(ifp, ifs6_out_request);

I'm = not quite sure, but it seems the `ifp` is not fully constructed. = See https://cgit.freebsd.org/src/tree/sys/net/if.c#n950 

If I read the code correctly, the = clone created interface is made visible via `if_link_ifnet(ifp);` , and = at that time the
`ifp->if_afdata[AF_INET6]` is NULL and is = not initialized yet by `if_attachdomain1()` which will call = `in6_domifattach()`
to allocate the required = data.

So I guess there is a race = condition. I bet this can be repeated easily.

I have not tested this yet, and not sure if it is = the right fix, but you can give it a try.

diff --git a/sys/net/if.c = b/sys/net/if.c
index c3c27fbf678f..16ee5667e7bb = 100644
--- a/sys/net/if.c
+++ = b/sys/net/if.c
@@ -947,11 +947,11 @@ if_attach_internal(struct = ifnet *ifp, bool vmove)
        = }
 #endif
 
-     =   if_link_ifnet(ifp);
-
      =   if (domain_init_status >=3D 2)
      =           = if_attachdomain1(ifp);
 
+       = if_link_ifnet(ifp);
+
        = EVENTHANDLER_INVOKE(ifnet_arrival_event, ifp);
    =     if (IS_DEFAULT_VNET(curvnet))
    =             devctl_notify("IFNET", = ifp->if_xname, "ATTACH", NULL);

=    812 =         }
=    813
   814 =         /* Setup data structures = for scope ID checks. */

--
Bjoern A. Zeeb =             &n= bsp;           &nbs= p;            =             &n= bsp;  r15:7


Best regards,
Zhenlei

= --Apple-Mail=_0715C355-6B28-4360-86DE-DF9D867C1F8C--