- SODEFUNCTLOG(("%s[%d]: (target pid %d level %d) so 0x%llx [%s "
- "%s:%d -> %s:%d] is now defunct [rcv_si 0x%x, snd_si 0x%x, "
- "rcv_fl 0x%x, snd_fl 0x%x]\n", __func__, proc_selfpid(),
- proc_pid(p), level, (uint64_t)DEBUG_KERNEL_ADDRPERM(so),
- (SOCK_TYPE(so) == SOCK_STREAM) ? "TCP" : "UDP",
- inet_ntop(SOCK_DOM(so), ((SOCK_DOM(so) == PF_INET) ?
- (void *)&inp->inp_laddr.s_addr : (void *)&inp->in6p_laddr),
- s, sizeof (s)), ntohs(inp->in6p_lport),
- inet_ntop(SOCK_DOM(so), (SOCK_DOM(so) == PF_INET) ?
- (void *)&inp->inp_faddr.s_addr : (void *)&inp->in6p_faddr,
- d, sizeof (d)), ntohs(inp->in6p_fport),
+ if (p != PROC_NULL) {
+ SODEFUNCTLOG(
+ "%s[%d, %s]: (target pid %d name %s level %d) "
+ "so 0x%llx [%s %s:%d -> %s:%d] is now defunct "
+ "[rcv_si 0x%x, snd_si 0x%x, rcv_fl 0x%x, "
+ " snd_fl 0x%x]\n", __func__,
+ proc_selfpid(), proc_best_name(current_proc()),
+ proc_pid(p), proc_best_name(p), level,
+ (uint64_t)DEBUG_KERNEL_ADDRPERM(so),
+ (SOCK_TYPE(so) == SOCK_STREAM) ? "TCP" : "UDP",
+ inet_ntop(SOCK_DOM(so), ((SOCK_DOM(so) == PF_INET) ?
+ (void *)&inp->inp_laddr.s_addr :
+ (void *)&inp->in6p_laddr),
+ s, sizeof(s)), ntohs(inp->in6p_lport),
+ inet_ntop(SOCK_DOM(so), (SOCK_DOM(so) == PF_INET) ?
+ (void *)&inp->inp_faddr.s_addr :
+ (void *)&inp->in6p_faddr,
+ d, sizeof(d)), ntohs(inp->in6p_fport),
+ (uint32_t)rcv->sb_sel.si_flags,
+ (uint32_t)snd->sb_sel.si_flags,
+ rcv->sb_flags, snd->sb_flags);
+ }
+ } else if (p != PROC_NULL) {
+ SODEFUNCTLOG("%s[%d, %s]: (target pid %d name %s level %d) "
+ "so 0x%llx [%d,%d] is now defunct [rcv_si 0x%x, "
+ "snd_si 0x%x, rcv_fl 0x%x, snd_fl 0x%x]\n", __func__,
+ proc_selfpid(), proc_best_name(current_proc()),
+ proc_pid(p), proc_best_name(p), level,
+ (uint64_t)DEBUG_KERNEL_ADDRPERM(so),
+ SOCK_DOM(so), SOCK_TYPE(so),