Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repeated cycles accessing telnet and FTP will fail #364

Open
classilla opened this issue Jul 26, 2023 · 7 comments
Open

repeated cycles accessing telnet and FTP will fail #364

classilla opened this issue Jul 26, 2023 · 7 comments

Comments

@classilla
Copy link

After 10 cycles of FTPing a file to the storage and then running it from the Telnet server, FTP will suddenly become unresponsive. You can trigger it by repeating a command line like

curl -T u2rtc.prg ftp://bil/Temp/u2rtc.prg ; echo x | nc bil 23

10 times. On the 11th time, the FTP portion will time out until the cartridge is powered off and back on. Ultimate-II Plus 3.10f (11D) on a U2+L.

@Grrrolf
Copy link

Grrrolf commented Jul 30, 2023

The latest version of the firmware is version 3.10j .

What happens if you do not do a 10-times consecutive overwrite of the same file but upload 11 different files?

@GideonZ
Copy link
Owner

GideonZ commented Aug 10, 2023

I tried to replicate this by issuing wput commands from the command line, and was unable to reproduce it. However, there is always a bit of time between the commands given. Maybe I should try this in a batch file.

@classilla
Copy link
Author

You have to alternate Telnet with FTP; repeated back-to-back FTP transactions work fine. The workflow here is uploading a file, then connecting with Telnet to make the Commodore run it.

The file doesn't matter, it can be different or the same. It also behaves the same whether writing to Usb0 or to Temp.

@scjody
Copy link

scjody commented Oct 25, 2023

I can reproduce this with 3.10j on an U2+L without using ftp at all. The first 12 telnet connections succeed and show the usual menu. After that, the connection is established but is immediately closed by the U2. I haven't found a way out of this state other than power off / power on.

Looking at the packets in Wireshark, the first 12 connections appear normal. With the failing connection, the usual 3-way handshake happens, the client sends a packet with telnet options (or a \n in the nc example below), and the U2 responds with 2 or 3 RST packets, closing the connection.

Running this nc command 13 times will demonstrate the issue: echo | nc -v c64 23
For a oneliner:

for s in `seq 1 13` ; do echo | nc -v c64 23 ; done

I also tried adding a long sleep (e.g. sleep 60) to the for loop above and it still fails.

@scjody
Copy link

scjody commented Nov 13, 2023

I'm unable to reproduce this with ftp at all. It seems to be just a telnet issue. 12 telnets, with or without ftp commands in between, will reliably break the network stack such that any new connections (ftp or telnet) result in 2-3 immediate RST packets rather than a successful connection.

@GideonZ
Copy link
Owner

GideonZ commented Nov 13, 2023 via email

scjody added a commit to scjody/1541ultimate that referenced this issue Nov 13, 2023
scjody added a commit to scjody/1541ultimate that referenced this issue Nov 13, 2023
@scjody
Copy link

scjody commented Nov 13, 2023

Using lwip_close() (which is what ftpd does) instead of shutdown() fixes the issue - see #382

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants