Skip to content

Commit

Permalink
fix MSS for non-1500 MTU
Browse files Browse the repository at this point in the history
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
  • Loading branch information
AkihiroSuda committed Jan 7, 2019
1 parent 1508a66 commit 19f3f41
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
13 changes: 0 additions & 13 deletions qemu/slirp/tcp.h
Expand Up @@ -96,19 +96,6 @@ struct tcphdr {
#define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */
#endif

/*
* Default maximum segment size for TCP.
* With an IP MSS of 576, this is 536,
* but 512 is probably more convenient.
* This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)).
*
* We make this 1460 because we only care about Ethernet in the qemu context.
*/
#undef TCP_MSS
#define TCP_MSS 1460
#undef TCP6_MSS
#define TCP6_MSS 1440

#undef TCP_MAXWIN
#define TCP_MAXWIN 65535 /* largest value for (unscaled) window */

Expand Down
2 changes: 1 addition & 1 deletion qemu/slirp/tcp_subr.c
Expand Up @@ -262,7 +262,7 @@ tcp_newtcpcb(struct socket *so)

memset((char *) tp, 0, sizeof(struct tcpcb));
tp->seg_next = tp->seg_prev = (struct tcpiphdr*)tp;
tp->t_maxseg = (so->so_ffamily == AF_INET) ? TCP_MSS : TCP6_MSS;
tp->t_maxseg = so->slirp->if_mtu - ((so->so_ffamily == AF_INET) ? 40 : 60);

tp->t_flags = TCP_DO_RFC1323 ? (TF_REQ_SCALE|TF_REQ_TSTMP) : 0;
tp->t_socket = so;
Expand Down

0 comments on commit 19f3f41

Please sign in to comment.