aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_output.c
diff options
context:
space:
mode:
authorGeorge V. Neville-Neil <gnn@FreeBSD.org>2016-03-24 07:54:56 +0000
committerGeorge V. Neville-Neil <gnn@FreeBSD.org>2016-03-24 07:54:56 +0000
commit84cc0778d06816e6b0676b9f7133e747e3d8b7c8 (patch)
treee930aaa09aa8f724ba7ca61b6ec317d3c5bf9cee /sys/netinet/tcp_output.c
parent1c9b29f95faf43b12e230f5e95c94ffc044c37bd (diff)
downloadsrc-84cc0778d06816e6b0676b9f7133e747e3d8b7c8.tar.gz
src-84cc0778d06816e6b0676b9f7133e747e3d8b7c8.zip
FreeBSD previously provided route caching for TCP (and UDP). Re-add
route caching for TCP, with some improvements. In particular, invalidate the route cache if a new route is added, which might be a better match. The cache is automatically invalidated if the old route is deleted. Submitted by: Mike Karels Reviewed by: gnn Differential Revision: https://reviews.freebsd.org/D4306
Notes
Notes: svn path=/head/; revision=297225
Diffstat (limited to 'sys/netinet/tcp_output.c')
-rw-r--r--sys/netinet/tcp_output.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
index d7fb75ddec4a..2043fc959bd1 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -1379,9 +1379,6 @@ send:
#endif
#ifdef INET
{
- struct route ro;
-
- bzero(&ro, sizeof(ro));
ip->ip_len = htons(m->m_pkthdr.len);
#ifdef INET6
if (tp->t_inpcb->inp_vflag & INP_IPV6PROTO)
@@ -1412,13 +1409,12 @@ send:
tcp_pcap_add(th, m, &(tp->t_outpkts));
#endif
- error = ip_output(m, tp->t_inpcb->inp_options, &ro,
+ error = ip_output(m, tp->t_inpcb->inp_options, &tp->t_inpcb->inp_route,
((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0), 0,
tp->t_inpcb);
- if (error == EMSGSIZE && ro.ro_rt != NULL)
- mtu = ro.ro_rt->rt_mtu;
- RO_RTFREE(&ro);
+ if (error == EMSGSIZE && tp->t_inpcb->inp_route.ro_rt != NULL)
+ mtu = tp->t_inpcb->inp_route.ro_rt->rt_mtu;
}
#endif /* INET */