1/*
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 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
--- 17 unchanged lines hidden (view full) ---
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95
34 * $FreeBSD: head/sys/netinet/tcp_input.c 121285 2003-10-20 16:19:01Z ume $
35 */
36
37#include "opt_ipfw.h" /* for ipfw_fwd */
38#include "opt_inet6.h"
39#include "opt_ipsec.h"
40#include "opt_mac.h"
41#include "opt_tcpdebug.h"
42#include "opt_tcp_input.h"
--- 248 unchanged lines hidden (view full) ---
291 do {
292 tp->rcv_nxt += q->tqe_len;
293 flags = q->tqe_th->th_flags & TH_FIN;
294 nq = LIST_NEXT(q, tqe_q);
295 LIST_REMOVE(q, tqe_q);
296 if (so->so_state & SS_CANTRCVMORE)
297 m_freem(q->tqe_m);
298 else
299 sbappend(&so->so_rcv, q->tqe_m);
300 FREE(q, M_TSEGQ);
301 q = nq;
302 } while (q && q->tqe_th->th_seq == tp->rcv_nxt);
303 ND6_HINT(tp);
304 sorwakeup(so);
305 return (flags);
306}
307
--- 811 unchanged lines hidden (view full) ---
1119 (void *)tcp_saveipgen, &tcp_savetcp, 0);
1120#endif
1121 * Add data to socket buffer.
1122 */
1123 if (so->so_state & SS_CANTRCVMORE) {
1124 m_freem(m);
1125 } else {
1126 m_adj(m, drop_hdrlen); /* delayed header drop */
1127 sbappend(&so->so_rcv, m);
1128 }
1129 sorwakeup(so);
1130 if (DELAY_ACK(tp)) {
1131 tp->t_flags |= TF_DELACK;
1132 } else {
1133 tp->t_flags |= TF_ACKNOW;
1134 tcp_output(tp);
1135 }
--- 1037 unchanged lines hidden (view full) ---
2173 tp->rcv_nxt += tlen;
2174 thflags = th->th_flags & TH_FIN;
2175 tcpstat.tcps_rcvpack++;
2176 tcpstat.tcps_rcvbyte += tlen;
2177 ND6_HINT(tp);
2178 if (so->so_state & SS_CANTRCVMORE)
2179 m_freem(m);
2180 else
2181 sbappend(&so->so_rcv, m);
2182 sorwakeup(so);
2183 } else {
2184 thflags = tcp_reass(tp, th, &tlen, m);
2185 tp->t_flags |= TF_ACKNOW;
2186 }
2187
2188 /*
2189 * Note the amount of data that peer has sent into
--- 844 unchanged lines hidden ---
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 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
--- 17 unchanged lines hidden (view full) ---
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95
34 * $FreeBSD: head/sys/netinet/tcp_input.c 121285 2003-10-20 16:19:01Z ume $
35 */
36
37#include "opt_ipfw.h" /* for ipfw_fwd */
38#include "opt_inet6.h"
39#include "opt_ipsec.h"
40#include "opt_mac.h"
41#include "opt_tcpdebug.h"
42#include "opt_tcp_input.h"
--- 248 unchanged lines hidden (view full) ---
291 do {
292 tp->rcv_nxt += q->tqe_len;
293 flags = q->tqe_th->th_flags & TH_FIN;
294 nq = LIST_NEXT(q, tqe_q);
295 LIST_REMOVE(q, tqe_q);
296 if (so->so_state & SS_CANTRCVMORE)
297 m_freem(q->tqe_m);
298 else
299 sbappend(&so->so_rcv, q->tqe_m);
300 FREE(q, M_TSEGQ);
301 q = nq;
302 } while (q && q->tqe_th->th_seq == tp->rcv_nxt);
303 ND6_HINT(tp);
304 sorwakeup(so);
305 return (flags);
306}
307
--- 811 unchanged lines hidden (view full) ---
1119 (void *)tcp_saveipgen, &tcp_savetcp, 0);
1120#endif
1121 * Add data to socket buffer.
1122 */
1123 if (so->so_state & SS_CANTRCVMORE) {
1124 m_freem(m);
1125 } else {
1126 m_adj(m, drop_hdrlen); /* delayed header drop */
1127 sbappend(&so->so_rcv, m);
1128 }
1129 sorwakeup(so);
1130 if (DELAY_ACK(tp)) {
1131 tp->t_flags |= TF_DELACK;
1132 } else {
1133 tp->t_flags |= TF_ACKNOW;
1134 tcp_output(tp);
1135 }
--- 1037 unchanged lines hidden (view full) ---
2173 tp->rcv_nxt += tlen;
2174 thflags = th->th_flags & TH_FIN;
2175 tcpstat.tcps_rcvpack++;
2176 tcpstat.tcps_rcvbyte += tlen;
2177 ND6_HINT(tp);
2178 if (so->so_state & SS_CANTRCVMORE)
2179 m_freem(m);
2180 else
2181 sbappend(&so->so_rcv, m);
2182 sorwakeup(so);
2183 } else {
2184 thflags = tcp_reass(tp, th, &tlen, m);
2185 tp->t_flags |= TF_ACKNOW;
2186 }
2187
2188 /*
2189 * Note the amount of data that peer has sent into
--- 844 unchanged lines hidden ---