[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [lwip-users] SOF_REUSEADDR & SOF_REUSEPORT
From: |
Kjell Andersson XW (LI/EAB) |
Subject: |
RE: [lwip-users] SOF_REUSEADDR & SOF_REUSEPORT |
Date: |
Tue, 13 Jan 2004 12:28:50 +0100 |
I think I found something strange in tcp_process():
case SYN_SENT:
LWIP_DEBUGF(TCP_INPUT_DEBUG, ("SYN-SENT: ackno %lu pcb->snd_nxt %lu unacked
%lu\n", ackno,
pcb->snd_nxt, ntohl(pcb->unacked->tcphdr->seqno)));
if (flags & (TCP_ACK | TCP_SYN) &&
ackno == ntohl(pcb->unacked->tcphdr->seqno) + 1) {
pcb->rcv_nxt = seqno + 1;
pcb->lastack = ackno;
pcb->snd_wnd = tcphdr->wnd;
pcb->snd_wl1 = seqno - 1; /* initialise to seqno - 1 to force window
update */
pcb->state = ESTABLISHED;
pcb->cwnd = pcb->mss;
--pcb->snd_queuelen;
LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_process: SYN-SENT --queuelen %u\n",
(unsigned int)pcb->snd_queuelen));
rseg = pcb->unacked;
pcb->unacked = rseg->next;
tcp_seg_free(rseg);
/* Parse any options in the SYNACK. */
tcp_parseopt(pcb);
/* Call the user specified function to call when sucessfully
* connected. */
TCP_EVENT_CONNECTED(pcb, ERR_OK, err);
tcp_ack(pcb);
}
break;
-------
Shouldn't the line:
if (flags & (TCP_ACK | TCP_SYN) &&
be:
if (flags&TCP_ACK && flags&TCP_SYN) &&
Otherwise it will go to ESTABLISHED on both TCP_ACK and TCP_SYN and
TCP_ACK|TCP_SYN?