SLiRP 64-bit fixes. Originally written by Gleb Natapov for QEMU.
This commit is contained in:
parent
03749ab0fb
commit
5a957e5d00
11 changed files with 156 additions and 233 deletions
|
|
@ -81,7 +81,7 @@ tcp_template(tp)
|
|||
struct SLIRPsocket *so = tp->t_socket;
|
||||
struct tcpiphdr *n = &tp->t_template;
|
||||
|
||||
n->ti_next = n->ti_prev = 0;
|
||||
n->ti_mbuf = NULL;
|
||||
n->ti_x1 = 0;
|
||||
n->ti_pr = IPPROTO_TCP;
|
||||
n->ti_len = htons(sizeof (struct tcpiphdr) - sizeof (struct ip));
|
||||
|
|
@ -164,7 +164,7 @@ tcp_respond(tp, ti, m, ack, seq, flags)
|
|||
tlen += sizeof (struct tcpiphdr);
|
||||
m->m_len = tlen;
|
||||
|
||||
ti->ti_next = ti->ti_prev = 0;
|
||||
ti->ti_mbuf = 0;
|
||||
ti->ti_x1 = 0;
|
||||
ti->ti_seq = htonl(seq);
|
||||
ti->ti_ack = htonl(ack);
|
||||
|
|
@ -204,7 +204,7 @@ tcp_newtcpcb(so)
|
|||
return ((struct tcpcb *)0);
|
||||
|
||||
memset((char *) tp, 0, sizeof(struct tcpcb));
|
||||
tp->seg_next = tp->seg_prev = (tcpiphdrp_32)tp;
|
||||
tp->seg_next = tp->seg_prev = (struct tcpiphdr*)tp;
|
||||
tp->t_maxseg = tcp_mssdflt;
|
||||
|
||||
tp->t_flags = tcp_do_rfc1323 ? (TF_REQ_SCALE|TF_REQ_TSTMP) : 0;
|
||||
|
|
@ -280,11 +280,11 @@ tcp_close(tp)
|
|||
DEBUG_ARG("tp = %lx", (long )tp);
|
||||
|
||||
/* free the reassembly queue, if any */
|
||||
t = (struct tcpiphdr *) tp->seg_next;
|
||||
while (t != (struct tcpiphdr *)tp) {
|
||||
t = (struct tcpiphdr *)t->ti_next;
|
||||
m = (struct SLIRPmbuf *) REASS_MBUF((struct tcpiphdr *)t->ti_prev);
|
||||
remque_32((struct tcpiphdr *) t->ti_prev);
|
||||
t = tcpfrag_list_first(tp);
|
||||
while (!tcpfrag_list_end(t, tp)) {
|
||||
t = tcpiphdr_next(t);
|
||||
m = tcpiphdr_prev(t)->ti_mbuf;
|
||||
remque(tcpiphdr2qlink(tcpiphdr_prev(t)));
|
||||
m_freem(m);
|
||||
}
|
||||
/* It's static */
|
||||
|
|
@ -1120,7 +1120,7 @@ do_prompt:
|
|||
* A typical packet for player version 1.0 (release version):
|
||||
*
|
||||
* 0000:50 4E 41 00 05
|
||||
* 0000:00 01 00 02 1B D7 00 00 67 E6 6C DC 63 00 12 50 .....×..gælÜc..P
|
||||
* 0000:00 01 00 02 1B D7 00 00 67 E6 6C DC 63 00 12 50 ..... | ||||