[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-devel] pcb->lbb = ISS - 1?
From: |
narke |
Subject: |
Re: [lwip-devel] pcb->lbb = ISS - 1? |
Date: |
Thu, 12 Apr 2012 23:02:37 +0800 |
On 10 April 2012 16:59, Kieran Mansley <address@hidden> wrote:
> On Tue, 2012-04-10 at 12:49 +0800, narke wrote:
>> I found the first segment (SYN) sent from a connection has a seqno of
>> tcp_next_iss() - 1, and this is because the segment was created with a
>> seqno equals with pcb-lbb, which was assigned with tcp_next_iss() in
>> the tcp_connect() function. Why is this '- 1' operation is
>> necessary?
>
> The code in question is I think this, from tcp_connect():
>
> iss = tcp_next_iss();
> pcb->snd_nxt = iss;
> pcb->lastack = iss - 1;
> pcb->snd_lbb = iss - 1;
>
> I'm not sure why it has been written that way. It does strike me as
> odd. snd_lbb is the sequence number of next byte to be buffered, so it
> would make sense for it to be equal to snd_nxt rather than lastack.
>
> In tcp_alloc() we do this instead:
>
> iss = tcp_next_iss();
> pcb->snd_wl2 = iss;
> pcb->snd_nxt = iss;
> pcb->lastack = iss;
> pcb->snd_lbb = iss;
>
> Kieran
>
So, do you think it's a conflicts or even an error?
--
Life is the only flaw in an otherwise perfect nonexistence
-- Schopenhauer
narke
public key at http://subkeys.pgp.net:11371 (address@hidden)