Update to slirp sources from QEMU 0.9.0:

- fix UDP (Jason Wessel)
- enable TCP_NODELAY for slirp redirection (Daniel Jacobowitz)
This commit is contained in:
gbeauche 2007-11-03 16:36:35 +00:00
parent b899d55068
commit 25c5b9599e
4 changed files with 13 additions and 4 deletions

View File

@ -1 +1 @@
qemu 0.8.2 (2006/07/14)
qemu 0.9.0 (2007/02/05)

View File

@ -119,8 +119,14 @@ struct tcphdr {
/*
* User-settable options (used with setsockopt).
*
* We don't use the system headers on unix because we have conflicting
* local structures. We can't avoid the system definitions on Windows,
* so we undefine them.
*/
/* #define TCP_NODELAY 0x01 */ /* don't delay send to coalesce packets */
#undef TCP_NODELAY
#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */
#undef TCP_MAXSEG
/* #define TCP_MAXSEG 0x02 */ /* set maximum segment size */
/*

View File

@ -500,6 +500,8 @@ tcp_connect(inso)
setsockopt(s,SOL_SOCKET,SO_REUSEADDR,(char *)&opt,sizeof(int));
opt = 1;
setsockopt(s,SOL_SOCKET,SO_OOBINLINE,(char *)&opt,sizeof(int));
opt = 1;
setsockopt(s,IPPROTO_TCP,TCP_NODELAY,(char *)&opt,sizeof(int));
so->so_fport = addr.sin_port;
so->so_faddr = addr.sin_addr;

View File

@ -205,8 +205,6 @@ udp_input(m, iphlen)
/* udp_last_so = so; */
so->so_laddr = ip->ip_src;
so->so_lport = uh->uh_sport;
so->so_faddr = ip->ip_dst; /* XXX */
so->so_fport = uh->uh_dport; /* XXX */
if ((so->so_iptos = udp_tos(so)) == 0)
so->so_iptos = ip->ip_tos;
@ -217,6 +215,9 @@ udp_input(m, iphlen)
*/
}
so->so_faddr = ip->ip_dst; /* XXX */
so->so_fport = uh->uh_dport; /* XXX */
iphlen += sizeof(struct udphdr);
m->m_len -= iphlen;
m->m_data += iphlen;