summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/netinet/tcp_input.c6
-rw-r--r--sys/netinet/tcp_reass.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 64cbed9..431c049 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -2665,7 +2665,8 @@ tcp_mss(tp, offer)
bufsize = roundup(bufsize, mss);
if (bufsize > sb_max)
bufsize = sb_max;
- (void)sbreserve(&so->so_snd, bufsize, so, NULL);
+ if (bufsize > so->so_snd.sb_hiwat)
+ (void)sbreserve(&so->so_snd, bufsize, so, NULL);
}
tp->t_maxseg = mss;
@@ -2677,7 +2678,8 @@ tcp_mss(tp, offer)
bufsize = roundup(bufsize, mss);
if (bufsize > sb_max)
bufsize = sb_max;
- (void)sbreserve(&so->so_rcv, bufsize, so, NULL);
+ if (bufsize > so->so_rcv.sb_hiwat)
+ (void)sbreserve(&so->so_rcv, bufsize, so, NULL);
}
/*
diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c
index 64cbed9..431c049 100644
--- a/sys/netinet/tcp_reass.c
+++ b/sys/netinet/tcp_reass.c
@@ -2665,7 +2665,8 @@ tcp_mss(tp, offer)
bufsize = roundup(bufsize, mss);
if (bufsize > sb_max)
bufsize = sb_max;
- (void)sbreserve(&so->so_snd, bufsize, so, NULL);
+ if (bufsize > so->so_snd.sb_hiwat)
+ (void)sbreserve(&so->so_snd, bufsize, so, NULL);
}
tp->t_maxseg = mss;
@@ -2677,7 +2678,8 @@ tcp_mss(tp, offer)
bufsize = roundup(bufsize, mss);
if (bufsize > sb_max)
bufsize = sb_max;
- (void)sbreserve(&so->so_rcv, bufsize, so, NULL);
+ if (bufsize > so->so_rcv.sb_hiwat)
+ (void)sbreserve(&so->so_rcv, bufsize, so, NULL);
}
/*
OpenPOWER on IntegriCloud