aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTao Wu <ytht.net@gmail.com>2017-04-29 19:20:56 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2017-05-27 23:34:47 +0200
commit107b793712cb4337826c4808aa05668c69cc018e (patch)
treeb69a69cb5cdaed5301c5381469d9d02def7126f3
parentaa5e2421f3e838a3f58ea951138043da37033ac6 (diff)
downloadslirp-107b793712cb4337826c4808aa05668c69cc018e.zip
slirp-107b793712cb4337826c4808aa05668c69cc018e.tar.gz
slirp-107b793712cb4337826c4808aa05668c69cc018e.tar.bz2
slirp: Fix wrong mss bug.
This bug was introduced by https://github.com/qemu/qemu/commit/98c6305 Signed-off-by: Tao Wu <lepton@google.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-bu: Samuel Thibault <samuel.thibault@ens-lyon.org>
-rw-r--r--tcp_input.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tcp_input.c b/tcp_input.c
index f6ceea5..eb4a326 100644
--- a/tcp_input.c
+++ b/tcp_input.c
@@ -1571,10 +1571,10 @@ int tcp_mss(struct tcpcb *tp, u_int offer)
switch (so->so_ffamily) {
case AF_INET:
- mss = MIN(IF_MTU, IF_MRU) - sizeof(struct tcphdr) + sizeof(struct ip);
+ mss = MIN(IF_MTU, IF_MRU) - sizeof(struct tcphdr) - sizeof(struct ip);
break;
case AF_INET6:
- mss = MIN(IF_MTU, IF_MRU) - sizeof(struct tcphdr) + sizeof(struct ip6);
+ mss = MIN(IF_MTU, IF_MRU) - sizeof(struct tcphdr) - sizeof(struct ip6);
break;
default:
g_assert_not_reached();