FreeBSD/sys/netipsec/key.c
/*
 * Must be called after calling key_allocsp().
 * For the packet with socket.
 */
Must be called after calling key_allocsp().
For the packet with socket.
Must be called after calling key_allocsp () . For the packet with socket .
void
key_freeso(struct socket *so)
{
	IPSEC_ASSERT(so != NULL, ("null so"));
	switch (so->so_proto->pr_domain->dom_family) {
#if defined(INET) || defined(INET6)
#ifdef INET
	case PF_INET:
#endif
#ifdef INET6
	case PF_INET6:
#endif
	    {
		struct inpcb *pcb = sotoinpcb(so);
		if (pcb == NULL)
			return;
		key_freesp_so(&pcb->inp_sp->sp_in);
		key_freesp_so(&pcb->inp_sp->sp_out);
	    }
		break;
#endif 
	default:
		ipseclog((LOG_DEBUG, "%s: unknown address family=%d.\n",
		    __func__, so->so_proto->pr_domain->dom_family));
		return;
	}
}
void key_freeso ( struct socket * so ) { IPSEC_ASSERT ( so != NULL , ( " " ) ) ; switch ( so -> so_proto -> pr_domain -> dom_family ) { #if defined ( INET ) || defined ( INET6 ) #ifdef INET case PF_INET : #endif #ifdef INET6 case PF_INET6 : #endif { struct inpcb * pcb = sotoinpcb ( so ) ; if ( pcb == NULL ) return ; key_freesp_so ( & pcb -> inp_sp -> sp_in ) ; key_freesp_so ( & pcb -> inp_sp -> sp_out ) ; } break ; #endif default : ipseclog ( ( LOG_DEBUG , " \n " , __func__ , so -> so_proto -> pr_domain -> dom_family ) ) ; return ; } }
Must be called after calling key_allocsp().
Must be called after calling key_allocsp () .
/* Does it have a PCB ? */ /* INET || INET6 */