|
From: | Mattia Settin |
Subject: | Re: [lwip-users] lwip 1.4.1 send a sporadic RST ACK |
Date: | Tue, 24 Oct 2017 17:38:54 +0200 |
2017-10-24 16:37 GMT+08:00 Axel Lin <address@hidden>:
> 2017-10-24 1:13 GMT+08:00 Mattia Settin <address@hidden>:
>> Dear all
>> After a week of debugging I finally find the issue. The problem is related to priority in pcb.
>> Taking a deep look I saw that the priority in the stack 1.4.1 is change, in particular:
>> Tcp_alloc return e pcb with a prior equal to the prior passed in input.
>> Tcp_listen_with_backlog return e pcb with a prior equal to the pcb.prior passed in input.
>> This two changes lead to a sporadic RST ACK call from the kill_prio routine.
>> Finally I fix this issue removing the equal condition in the kill_prio function.
>
> The comment on the code seems confusion for "the same priority case":
> (I check the latest git tree)
>
> Th comment on the caller:
> /* Try killing active connections with lower priority than
> the new one. */
> LWIP_DEBUGF(TCP_DEBUG, ("tcp_alloc: killing connection with
> prio lower than %d\n", prio));
> tcp_kill_prio(prio);
>
> But the comment on tcp_kill_prio() function:
> /**
> * Kills the oldest active connection that has the same or lower priority than
> * 'prio'.
The comment for tcp_kill_prio() is updated by:
commit 6a4c30fe5d65 fixed bug #31723 (tcp_kill_prio() kills pcbs with
the same prio) by updating its documentation only
And take a look at bug #31723: tcp_kill_prio() kills pcbs with the same prio
According to its documentation, tcp_kill_prio() kills "the oldest
active connection that has lower priority than prio". However, the
current code also kills connections with a priority equal to 'prio'.
We should either change the documentation or the implementation.
The downside of the current implementation is that every call to
tcp_new() can lead to aborting an old (active) connection.
This has been in there since revision 1.1 of tcp.c, so changing it
might involve changing applications relying on this (like I have one
:).
I'm wondering if it should change the implementation rather than the
documentation.
_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users
[Prev in Thread] | Current Thread | [Next in Thread] |