X-Git-Url: http://git.meshlink.io/?p=utcp;a=blobdiff_plain;f=utcp.c;h=d2a777ce00ed9b1d9ea18a622f1ab1523dcc74b5;hp=5d630694df96100f57e780f855a32cc63f7674bc;hb=d6f18182c43287c180e637046c044e8bff5e7064;hpb=efeb98dd555879d9fa1ec765615fe4a34b8ee438 diff --git a/utcp.c b/utcp.c index 5d63069..d2a777c 100644 --- a/utcp.c +++ b/utcp.c @@ -382,7 +382,6 @@ static struct utcp_connection *allocate_connection(struct utcp *utcp, uint16_t s #endif c->snd.una = c->snd.iss; c->snd.nxt = c->snd.iss + 1; - c->rcv.wnd = utcp->mtu; c->snd.last = c->snd.nxt; c->snd.cwnd = utcp->mtu; c->utcp = utcp; @@ -468,7 +467,7 @@ struct utcp_connection *utcp_connect_ex(struct utcp *utcp, uint16_t dst, utcp_re pkt.hdr.dst = c->dst; pkt.hdr.seq = c->snd.iss; pkt.hdr.ack = 0; - pkt.hdr.wnd = c->rcv.wnd; + pkt.hdr.wnd = c->rcvbuf.maxsize; pkt.hdr.ctl = SYN; pkt.hdr.aux = 0x0101; pkt.init[0] = 1; @@ -538,7 +537,7 @@ static void ack(struct utcp_connection *c, bool sendatleastone) { pkt->hdr.src = c->src; pkt->hdr.dst = c->dst; pkt->hdr.ack = c->rcv.nxt; - pkt->hdr.wnd = c->snd.wnd; + pkt->hdr.wnd = c->rcvbuf.maxsize; pkt->hdr.ctl = ACK; pkt->hdr.aux = 0; @@ -697,7 +696,7 @@ static void retransmit(struct utcp_connection *c) { pkt->hdr.src = c->src; pkt->hdr.dst = c->dst; - pkt->hdr.wnd = c->rcv.wnd; + pkt->hdr.wnd = c->rcvbuf.maxsize; pkt->hdr.aux = 0; switch(c->state) { @@ -1073,7 +1072,7 @@ synack: pkt.hdr.dst = c->dst; pkt.hdr.ack = c->rcv.irs + 1; pkt.hdr.seq = c->snd.iss; - pkt.hdr.wnd = c->rcv.wnd; + pkt.hdr.wnd = c->rcvbuf.maxsize; pkt.hdr.ctl = SYN | ACK; if(init) {