Deleted Added
full compact
tcp_output.c (251296) tcp_output.c (254889)
1/*-
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 16 unchanged lines hidden (view full) ---

25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)tcp_output.c 8.4 (Berkeley) 5/24/95
30 */
31
32#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 16 unchanged lines hidden (view full) ---

25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)tcp_output.c 8.4 (Berkeley) 5/24/95
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/netinet/tcp_output.c 251296 2013-06-03 12:55:13Z andre $");
33__FBSDID("$FreeBSD: head/sys/netinet/tcp_output.c 254889 2013-08-25 21:54:41Z markj $");
34
35#include "opt_inet.h"
36#include "opt_inet6.h"
37#include "opt_ipsec.h"
34
35#include "opt_inet.h"
36#include "opt_inet6.h"
37#include "opt_ipsec.h"
38#include "opt_kdtrace.h"
38#include "opt_tcpdebug.h"
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/domain.h>
43#include <sys/hhook.h>
44#include <sys/kernel.h>
45#include <sys/lock.h>
46#include <sys/mbuf.h>
47#include <sys/mutex.h>
48#include <sys/protosw.h>
39#include "opt_tcpdebug.h"
40
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/domain.h>
44#include <sys/hhook.h>
45#include <sys/kernel.h>
46#include <sys/lock.h>
47#include <sys/mbuf.h>
48#include <sys/mutex.h>
49#include <sys/protosw.h>
50#include <sys/sdt.h>
49#include <sys/socket.h>
50#include <sys/socketvar.h>
51#include <sys/sysctl.h>
52
53#include <net/if.h>
54#include <net/route.h>
55#include <net/vnet.h>
56
57#include <netinet/cc.h>
58#include <netinet/in.h>
51#include <sys/socket.h>
52#include <sys/socketvar.h>
53#include <sys/sysctl.h>
54
55#include <net/if.h>
56#include <net/route.h>
57#include <net/vnet.h>
58
59#include <netinet/cc.h>
60#include <netinet/in.h>
61#include <netinet/in_kdtrace.h>
59#include <netinet/in_systm.h>
60#include <netinet/ip.h>
61#include <netinet/in_pcb.h>
62#include <netinet/ip_var.h>
63#include <netinet/ip_options.h>
64#ifdef INET6
65#include <netinet6/in6_pcb.h>
66#include <netinet/ip6.h>

--- 1102 unchanged lines hidden (view full) ---

1169 /*
1170 * we separately set hoplimit for every segment, since the
1171 * user might want to change the value via setsockopt.
1172 * Also, desired default hop limit might be changed via
1173 * Neighbor Discovery.
1174 */
1175 ip6->ip6_hlim = in6_selecthlim(tp->t_inpcb, NULL);
1176
62#include <netinet/in_systm.h>
63#include <netinet/ip.h>
64#include <netinet/in_pcb.h>
65#include <netinet/ip_var.h>
66#include <netinet/ip_options.h>
67#ifdef INET6
68#include <netinet6/in6_pcb.h>
69#include <netinet/ip6.h>

--- 1102 unchanged lines hidden (view full) ---

1172 /*
1173 * we separately set hoplimit for every segment, since the
1174 * user might want to change the value via setsockopt.
1175 * Also, desired default hop limit might be changed via
1176 * Neighbor Discovery.
1177 */
1178 ip6->ip6_hlim = in6_selecthlim(tp->t_inpcb, NULL);
1179
1180 /*
1181 * Set the packet size here for the benefit of DTrace probes.
1182 * ip6_output() will set it properly; it's supposed to include
1183 * the option header lengths as well.
1184 */
1185 ip6->ip6_plen = htons(m->m_pkthdr.len - sizeof(*ip6));
1186
1187 if (tp->t_state == TCPS_SYN_SENT)
1188 TCP_PROBE5(connect_request, NULL, tp, ip6, tp, th);
1189
1190 TCP_PROBE5(send, NULL, tp, ip6, tp, th);
1191
1177 /* TODO: IPv6 IP6TOS_ECT bit on */
1178 error = ip6_output(m, tp->t_inpcb->in6p_outputopts, &ro,
1179 ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0),
1180 NULL, NULL, tp->t_inpcb);
1181
1182 if (error == EMSGSIZE && ro.ro_rt != NULL)
1183 mtu = ro.ro_rt->rt_rmx.rmx_mtu;
1184 RO_RTFREE(&ro);

--- 18 unchanged lines hidden (view full) ---

1203 * Section 2. However the tcp hostcache migitates the problem
1204 * so it affects only the first tcp connection with a host.
1205 *
1206 * NB: Don't set DF on small MTU/MSS to have a safe fallback.
1207 */
1208 if (V_path_mtu_discovery && tp->t_maxopd > V_tcp_minmss)
1209 ip->ip_off |= htons(IP_DF);
1210
1192 /* TODO: IPv6 IP6TOS_ECT bit on */
1193 error = ip6_output(m, tp->t_inpcb->in6p_outputopts, &ro,
1194 ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0),
1195 NULL, NULL, tp->t_inpcb);
1196
1197 if (error == EMSGSIZE && ro.ro_rt != NULL)
1198 mtu = ro.ro_rt->rt_rmx.rmx_mtu;
1199 RO_RTFREE(&ro);

--- 18 unchanged lines hidden (view full) ---

1218 * Section 2. However the tcp hostcache migitates the problem
1219 * so it affects only the first tcp connection with a host.
1220 *
1221 * NB: Don't set DF on small MTU/MSS to have a safe fallback.
1222 */
1223 if (V_path_mtu_discovery && tp->t_maxopd > V_tcp_minmss)
1224 ip->ip_off |= htons(IP_DF);
1225
1226 if (tp->t_state == TCPS_SYN_SENT)
1227 TCP_PROBE5(connect_request, NULL, tp, ip, tp, th);
1228
1229 TCP_PROBE5(send, NULL, tp, ip, tp, th);
1230
1211 error = ip_output(m, tp->t_inpcb->inp_options, &ro,
1212 ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0), 0,
1213 tp->t_inpcb);
1214
1215 if (error == EMSGSIZE && ro.ro_rt != NULL)
1216 mtu = ro.ro_rt->rt_rmx.rmx_mtu;
1217 RO_RTFREE(&ro);
1218 }

--- 343 unchanged lines hidden ---
1231 error = ip_output(m, tp->t_inpcb->inp_options, &ro,
1232 ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0), 0,
1233 tp->t_inpcb);
1234
1235 if (error == EMSGSIZE && ro.ro_rt != NULL)
1236 mtu = ro.ro_rt->rt_rmx.rmx_mtu;
1237 RO_RTFREE(&ro);
1238 }

--- 343 unchanged lines hidden ---