Deleted Added
full compact
tcp_reass.c (130989) tcp_reass.c (131006)
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_reass.c 130989 2004-06-23 21:04:37Z ps $
30 * $FreeBSD: head/sys/netinet/tcp_reass.c 131006 2004-06-24 01:37:04Z rwatson $
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"

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

2985
2986 /*
2987 * If there's a pipesize, change the socket buffer to that size,
2988 * don't change if sb_hiwat is different than default (then it
2989 * has been changed on purpose with setsockopt).
2990 * Make the socket buffers an integral number of mss units;
2991 * if the mss is larger than the socket buffer, decrease the mss.
2992 */
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"

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

2985
2986 /*
2987 * If there's a pipesize, change the socket buffer to that size,
2988 * don't change if sb_hiwat is different than default (then it
2989 * has been changed on purpose with setsockopt).
2990 * Make the socket buffers an integral number of mss units;
2991 * if the mss is larger than the socket buffer, decrease the mss.
2992 */
2993 SOCKBUF_LOCK(&so->so_snd);
2993 if ((so->so_snd.sb_hiwat == tcp_sendspace) && metrics.rmx_sendpipe)
2994 bufsize = metrics.rmx_sendpipe;
2995 else
2996 bufsize = so->so_snd.sb_hiwat;
2997 if (bufsize < mss)
2998 mss = bufsize;
2999 else {
3000 bufsize = roundup(bufsize, mss);
3001 if (bufsize > sb_max)
3002 bufsize = sb_max;
3003 if (bufsize > so->so_snd.sb_hiwat)
2994 if ((so->so_snd.sb_hiwat == tcp_sendspace) && metrics.rmx_sendpipe)
2995 bufsize = metrics.rmx_sendpipe;
2996 else
2997 bufsize = so->so_snd.sb_hiwat;
2998 if (bufsize < mss)
2999 mss = bufsize;
3000 else {
3001 bufsize = roundup(bufsize, mss);
3002 if (bufsize > sb_max)
3003 bufsize = sb_max;
3004 if (bufsize > so->so_snd.sb_hiwat)
3004 (void)sbreserve(&so->so_snd, bufsize, so, NULL);
3005 (void)sbreserve_locked(&so->so_snd, bufsize, so, NULL);
3005 }
3006 }
3007 SOCKBUF_UNLOCK(&so->so_snd);
3006 tp->t_maxseg = mss;
3007
3008 tp->t_maxseg = mss;
3009
3010 SOCKBUF_LOCK(&so->so_rcv);
3008 if ((so->so_rcv.sb_hiwat == tcp_recvspace) && metrics.rmx_recvpipe)
3009 bufsize = metrics.rmx_recvpipe;
3010 else
3011 bufsize = so->so_rcv.sb_hiwat;
3012 if (bufsize > mss) {
3013 bufsize = roundup(bufsize, mss);
3014 if (bufsize > sb_max)
3015 bufsize = sb_max;
3016 if (bufsize > so->so_rcv.sb_hiwat)
3011 if ((so->so_rcv.sb_hiwat == tcp_recvspace) && metrics.rmx_recvpipe)
3012 bufsize = metrics.rmx_recvpipe;
3013 else
3014 bufsize = so->so_rcv.sb_hiwat;
3015 if (bufsize > mss) {
3016 bufsize = roundup(bufsize, mss);
3017 if (bufsize > sb_max)
3018 bufsize = sb_max;
3019 if (bufsize > so->so_rcv.sb_hiwat)
3017 (void)sbreserve(&so->so_rcv, bufsize, so, NULL);
3020 (void)sbreserve_locked(&so->so_rcv, bufsize, so, NULL);
3018 }
3021 }
3022 SOCKBUF_UNLOCK(&so->so_rcv);
3019 /*
3020 * While we're here, check the others too
3021 */
3022 if (tp->t_srtt == 0 && (rtt = metrics.rmx_rtt)) {
3023 tp->t_srtt = rtt;
3024 tp->t_rttbest = tp->t_srtt + TCP_RTT_SCALE;
3025 tcpstat.tcps_usedrtt++;
3026 if (metrics.rmx_rttvar) {

--- 284 unchanged lines hidden ---
3023 /*
3024 * While we're here, check the others too
3025 */
3026 if (tp->t_srtt == 0 && (rtt = metrics.rmx_rtt)) {
3027 tp->t_srtt = rtt;
3028 tp->t_rttbest = tp->t_srtt + TCP_RTT_SCALE;
3029 tcpstat.tcps_usedrtt++;
3030 if (metrics.rmx_rttvar) {

--- 284 unchanged lines hidden ---