Deleted Added
full compact
tcp_input.c (157609) tcp_input.c (157927)
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

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

22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
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_input.c 8.12 (Berkeley) 5/24/95
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

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

22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
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_input.c 8.12 (Berkeley) 5/24/95
30 * $FreeBSD: head/sys/netinet/tcp_input.c 157609 2006-04-09 16:59:19Z rwatson $
30 * $FreeBSD: head/sys/netinet/tcp_input.c 157927 2006-04-21 09:25:40Z ps $
31 */
32
33#include "opt_ipfw.h" /* for ipfw_fwd */
34#include "opt_inet.h"
35#include "opt_inet6.h"
36#include "opt_ipsec.h"
37#include "opt_mac.h"
38#include "opt_tcpdebug.h"

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

197 * - this is a half-synchronized T/TCP connection.
198 */
199#define DELAY_ACK(tp) \
200 ((!callout_active(tp->tt_delack) && \
201 (tp->t_flags & TF_RXWIN0SENT) == 0) && \
202 (tcp_delack_enabled || (tp->t_flags & TF_NEEDSYN)))
203
204/* Initialize TCP reassembly queue */
31 */
32
33#include "opt_ipfw.h" /* for ipfw_fwd */
34#include "opt_inet.h"
35#include "opt_inet6.h"
36#include "opt_ipsec.h"
37#include "opt_mac.h"
38#include "opt_tcpdebug.h"

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

197 * - this is a half-synchronized T/TCP connection.
198 */
199#define DELAY_ACK(tp) \
200 ((!callout_active(tp->tt_delack) && \
201 (tp->t_flags & TF_RXWIN0SENT) == 0) && \
202 (tcp_delack_enabled || (tp->t_flags & TF_NEEDSYN)))
203
204/* Initialize TCP reassembly queue */
205static void
206tcp_reass_zone_change(void *tag)
207{
208
209 tcp_reass_maxseg = nmbclusters / 16;
210 uma_zone_set_max(tcp_reass_zone, tcp_reass_maxseg);
211}
212
205uma_zone_t tcp_reass_zone;
206void
207tcp_reass_init()
208{
209 tcp_reass_maxseg = nmbclusters / 16;
210 TUNABLE_INT_FETCH("net.inet.tcp.reass.maxsegments",
211 &tcp_reass_maxseg);
212 tcp_reass_zone = uma_zcreate("tcpreass", sizeof (struct tseg_qent),
213 NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
214 uma_zone_set_max(tcp_reass_zone, tcp_reass_maxseg);
213uma_zone_t tcp_reass_zone;
214void
215tcp_reass_init()
216{
217 tcp_reass_maxseg = nmbclusters / 16;
218 TUNABLE_INT_FETCH("net.inet.tcp.reass.maxsegments",
219 &tcp_reass_maxseg);
220 tcp_reass_zone = uma_zcreate("tcpreass", sizeof (struct tseg_qent),
221 NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
222 uma_zone_set_max(tcp_reass_zone, tcp_reass_maxseg);
223 EVENTHANDLER_REGISTER(nmbclusters_change,
224 tcp_reass_zone_change, NULL, EVENTHANDLER_PRI_ANY);
215}
216
217static int
218tcp_reass(tp, th, tlenp, m)
219 register struct tcpcb *tp;
220 register struct tcphdr *th;
221 int *tlenp;
222 struct mbuf *m;

--- 3058 unchanged lines hidden ---
225}
226
227static int
228tcp_reass(tp, th, tlenp, m)
229 register struct tcpcb *tp;
230 register struct tcphdr *th;
231 int *tlenp;
232 struct mbuf *m;

--- 3058 unchanged lines hidden ---