diff options
author | bryanv <bryanv@FreeBSD.org> | 2014-11-08 02:47:23 +0000 |
---|---|---|
committer | bryanv <bryanv@FreeBSD.org> | 2014-11-08 02:47:23 +0000 |
commit | 018ace964f7d4ab0ebf5870b68f595bfd5a515a9 (patch) | |
tree | e956fec7e6c6c986a5f10af748b5be112ff1dd9e /sys/netinet6 | |
parent | 520007fcf463e48dc65f68dcb1679713c2e1df54 (diff) | |
download | FreeBSD-src-018ace964f7d4ab0ebf5870b68f595bfd5a515a9.zip FreeBSD-src-018ace964f7d4ab0ebf5870b68f595bfd5a515a9.tar.gz |
MFC r272801:
Move the calls to u_tun_func() into udp6_append()
A similar cleanup for UDPv4 was performed in r220620.
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/udp6_usrreq.c | 44 |
1 files changed, 12 insertions, 32 deletions
diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 56f1eb2..49bd337 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -139,9 +139,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)) { @@ -359,20 +368,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); } } @@ -402,16 +398,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); } @@ -490,15 +478,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); |