- status: open --> pending-fixed
- Group: Reproducable --> 3.0b6
It looks like there's a stack imbalance here. (I haven't actually seen this code get hit, but it would be a problem if it did).
The sequence number is pushed on the stack, but if there's a wrong sequence number, it isn't removed.
INITIAL_SYNSENT DBGMSG INITIAL_SYNSENT
* Is there an PCK?
LDY #tcp_code
LDA [TCPHEADER],Y
AND #TCPF_ACK
BEQL :SKIPACK
LDY #tcp_ack ;get his ack number
LDA [TCPHEADER],Y
XBA
PHA << push 2 bytes
INY
INY
LDA [TCPHEADER],Y
XBA
PHA << push 2 bytes
LDY #uwSND_NXT ;same as my next?
LDA [USERPTR],Y
CMP 1,S
BNE :RESETSYN <<< if this branch is taken
INY
INY
LDA [USERPTR],Y
CMP 1+2,S
BNE :RESETSYN
PLS 2 << pulls them here
BRA :ACKOK
* Not correct sequence number. Must be an older connection. Reset it.
:RESETSYN LDY #tcp_code
LDA [TCPHEADER],Y
AND #TCPF_RST
BEQ :RSTOK << and this branch is not taken
<<<< need to remove them from the stack here.
; kws -- remove sequence number from stack
PLA
PLA
<<<<
TCPSAY ' wrong sequence number - dropping segment.',0D
JMP POLLPURGE
:RSTOK TCPSAY ' wrong sequence number, sending <RST>.',0D
PLXA ;got the wrong sequence number <<< pulls them here.
JSR SEND_RST ;reset it
JMP POLLPURGE