summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/udp6_usrreq.c
diff options
context:
space:
mode:
authormelifaro <melifaro@FreeBSD.org>2014-10-09 15:35:28 +0000
committermelifaro <melifaro@FreeBSD.org>2014-10-09 15:35:28 +0000
commitd23efba7dd470e247cbcacf9ec6cf642d02d5b8c (patch)
tree6d2822f6a5ff6c5c487b859a557d076b53b03c46 /sys/netinet6/udp6_usrreq.c
parentcab1d703b61e2216f130c6d1a23ca70b2b322386 (diff)
parentc47600c4ec062b8225ac1d48197a2a1de778760d (diff)
downloadFreeBSD-src-d23efba7dd470e247cbcacf9ec6cf642d02d5b8c.zip
FreeBSD-src-d23efba7dd470e247cbcacf9ec6cf642d02d5b8c.tar.gz
Sync to HEAD@r272825.
Diffstat (limited to 'sys/netinet6/udp6_usrreq.c')
-rw-r--r--sys/netinet6/udp6_usrreq.c46
1 files changed, 13 insertions, 33 deletions
diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c
index e36f778..9ee75a0 100644
--- a/sys/netinet6/udp6_usrreq.c
+++ b/sys/netinet6/udp6_usrreq.c
@@ -141,9 +141,18 @@ udp6_append(struct inpcb *inp, struct mbuf *n, int off,
{
struct socket *so;
struct mbuf *opts;
+ struct udpcb *up;
INP_LOCK_ASSERT(inp);
+ /*
+ * Engage the tunneling protocol.
+ */
+ up = intoudpcb(inp);
+ if (up->u_tun_func != NULL) {
+ (*up->u_tun_func)(n, off, inp);
+ return;
+ }
#ifdef IPSEC
/* Check AH/ESP integrity. */
if (ipsec6_in_reject(n, inp)) {
@@ -265,7 +274,7 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
if (uh_sum != 0) {
UDPSTAT_INC(udps_badsum);
- /*goto badunlocked;*/
+ goto badunlocked;
}
/*
@@ -361,20 +370,7 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
if ((n = m_copy(m, 0, M_COPYALL)) != NULL) {
INP_RLOCK(last);
- up = intoudpcb(last);
- 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);
- }
+ udp6_append(last, n, off, &fromsa);
INP_RUNLOCK(last);
}
}
@@ -404,16 +400,8 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
}
INP_RLOCK(last);
INP_INFO_RUNLOCK(pcbinfo);
- up = intoudpcb(last);
UDP_PROBE(receive, NULL, last, ip6, last, uh);
- if (up->u_tun_func == NULL) {
- udp6_append(last, m, off, &fromsa);
- } else {
- /*
- * Engage the tunneling protocol.
- */
- (*up->u_tun_func)(m, off, last);
- }
+ udp6_append(last, m, off, &fromsa);
INP_RUNLOCK(last);
return (IPPROTO_DONE);
}
@@ -492,15 +480,7 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
}
}
UDP_PROBE(receive, NULL, inp, ip6, inp, uh);
- if (up->u_tun_func == NULL) {
- udp6_append(inp, m, off, &fromsa);
- } else {
- /*
- * Engage the tunneling protocol.
- */
-
- (*up->u_tun_func)(m, off, inp);
- }
+ udp6_append(inp, m, off, &fromsa);
INP_RUNLOCK(inp);
return (IPPROTO_DONE);
OpenPOWER on IntegriCloud