Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/udp6_usrreq.c
Context not available. | |||||
{ | { | ||||
struct socket *so; | struct socket *so; | ||||
struct mbuf *opts; | struct mbuf *opts; | ||||
struct udpcb *up; | |||||
INP_LOCK_ASSERT(inp); | INP_LOCK_ASSERT(inp); | ||||
/* | |||||
* Engage the tunneling protocol. | |||||
*/ | |||||
up = intoudpcb(inp); | |||||
if (up->u_tun_func != NULL) { | |||||
(*up->u_tun_func)(n, off, inp, (struct sockaddr *) fromsa, | |||||
up->u_tun_func_ctx); | |||||
return; | |||||
} | |||||
#ifdef IPSEC | #ifdef IPSEC | ||||
/* Check AH/ESP integrity. */ | /* Check AH/ESP integrity. */ | ||||
if (ipsec6_in_reject(n, inp)) { | if (ipsec6_in_reject(n, inp)) { | ||||
Context not available. | |||||
if ((n = m_copy(m, 0, M_COPYALL)) != NULL) { | if ((n = m_copy(m, 0, M_COPYALL)) != NULL) { | ||||
INP_RLOCK(last); | INP_RLOCK(last); | ||||
up = intoudpcb(last); | udp6_append(last, n, off, &fromsa); | ||||
if (up->u_tun_func == NULL) { | |||||
udp6_append(last, n, off, &fromsa); | |||||
} else { | |||||
/* | |||||
* Engage the tunneling | |||||
* protocol we will have to | |||||
* leave the info_lock up, | |||||
* since we are hunting | |||||
* through multiple UDP's. | |||||
* | |||||
*/ | |||||
(*up->u_tun_func)(n, off, last); | |||||
} | |||||
INP_RUNLOCK(last); | INP_RUNLOCK(last); | ||||
} | } | ||||
} | } | ||||
Context not available. | |||||
INP_INFO_RUNLOCK(pcbinfo); | INP_INFO_RUNLOCK(pcbinfo); | ||||
up = intoudpcb(last); | up = intoudpcb(last); | ||||
UDP_PROBE(receive, NULL, last, ip6, last, uh); | UDP_PROBE(receive, NULL, last, ip6, last, uh); | ||||
if (up->u_tun_func == NULL) { | udp6_append(last, m, off, &fromsa); | ||||
udp6_append(last, m, off, &fromsa); | |||||
} else { | |||||
/* | |||||
* Engage the tunneling protocol. | |||||
*/ | |||||
(*up->u_tun_func)(m, off, last); | |||||
} | |||||
INP_RUNLOCK(last); | INP_RUNLOCK(last); | ||||
return (IPPROTO_DONE); | return (IPPROTO_DONE); | ||||
} | } | ||||
Context not available. | |||||
} | } | ||||
} | } | ||||
UDP_PROBE(receive, NULL, inp, ip6, inp, uh); | UDP_PROBE(receive, NULL, inp, ip6, inp, uh); | ||||
if (up->u_tun_func == NULL) { | udp6_append(inp, m, off, &fromsa); | ||||
udp6_append(inp, m, off, &fromsa); | |||||
} else { | |||||
/* | |||||
* Engage the tunneling protocol. | |||||
*/ | |||||
(*up->u_tun_func)(m, off, inp); | |||||
} | |||||
INP_RUNLOCK(inp); | INP_RUNLOCK(inp); | ||||
return (IPPROTO_DONE); | return (IPPROTO_DONE); | ||||
Context not available. |