slirp: Fix wrong mss bug.
authorTao Wu <ytht.net@gmail.com>
Sat, 29 Apr 2017 17:20:56 +0000 (19:20 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sat, 27 May 2017 21:34:47 +0000 (23:34 +0200)
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>

slirp/tcp_input.c

index edb98f06f305fec183d1b101b6c15d44d80981f8..07bcbdb2dddcabfa181b5047d770160ade4bc9bb 100644 (file)
@@ -1587,11 +1587,11 @@ 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);
+                                     - sizeof(struct ip);
            break;
        case AF_INET6:
             mss = MIN(IF_MTU, IF_MRU) - sizeof(struct tcphdr)
-                                     + sizeof(struct ip6);
+                                     - sizeof(struct ip6);
            break;
        default:
            g_assert_not_reached();