ftp connection with AR7 processors doesn't work properly

Bug #313257 reported by Paolo
2
Affects Status Importance Assigned to Milestone
netkit-ftp (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

ftp connection to ADAM2 server of AR7 processor do not work properly from Ubuntu (and Debian testing).
I had this experience which was confirmed by : http://wiki.openwrt.org/OpenWrtDocs/Hardware/Netgear/DG834G
 "Note by fw_crocodile : I've got a lot of difficulties to upload the firmware with the ftp command on debian testing, got it working easily using ftp on windows XP"

ftp connection works perfectly from windows 2000/XP and allows setting variables and flashing the unit.

when connecting ftp to ADAM2 with ubuntu, there is a delay between instruction and return of the instruction from the server. This delay becames bigger & bigger with use and do not allow to execute safe flashing operations, which need many commands.

ADAM2 ftp server answers also to telnet calls on port 21, and works perfectly from there, but not all the instructions needed to flash the unit can be executed by this way.

This obliged me to ask for a W$ pc to friends in order to flash the unit...

Paolo

Revision history for this message
Alistair Buxton (a-j-buxton) wrote :

Getting the same problem here. The data connection stalls after sending the first 16k.

Changed in netkit-ftp (Ubuntu):
status: New → Confirmed
Revision history for this message
Alistair Buxton (a-j-buxton) wrote :

I was able to successfully flash using Windows running in Virtualbox. In the past I have also successfully flashed using older Ubuntu versions, but it was a couple of years ago... probably 7.04 or 6.10.

Revision history for this message
Paolo (paolo-notari) wrote :

a partial answer to my problem :

The ftp version of ubuntu seems to be newer and more complete than the one existing on windows, and instructions are slighly differents :
this is (strongly) inspired by job done by people working on Fritz AVM:
http://www.vocesuip.com/entrare_nel_fritz_via_ftp_o_telnet_da_linux_ubuntu-t10096.0.html (in Italian)

flashing via ftp from ubuntu an image which is is the same directory we're working, EG RouterTech.img

1) killing network manager and any service manipulating the network interfaces (media senses)
2) attributing to the network interface (EG eth0) a fixed ip, in the range of the router's address :
EG: router's address : 192.168.1.1
sudo ifconfig eth0 192.168.1.3 up
3) ftp 192.168.1.1
while booting the router
NB : it works if a switch is interposed between the router and the pc
4) login with adam2/adam2
5) ftp commands are
debug
bin
quote MEDIA FLSH
put RouterTech.img "RouterTech.img mtd4"
quit

Flash was successfully obtained - on the contrary, I wasn't able (up to now) to change mtds, I get a strange delay in answer when trying to execute quote GETENV mtd0.

Revision history for this message
Paolo (paolo-notari) wrote :

telnet 192.168.1.1 21
connects on ftp server;

GETENV mtd0
works here

answer is on 3 lines :

1) mtdx addrss1,addrss2
2) empty line
3) GETENV successfull

On the contrary, ubuntu ftp client understand the end of line of the first line as the end of the answer, and understand second line as the answer to the following instruction.

Revision history for this message
Paolo (paolo-notari) wrote :

from RFC959 :

"A ftp reply is defined to contain the 3-digit code, followed by Space <SP>, followed by one line of text (where some maximum line length has been specified), and terminated by the Telnet end-of-line code. There will be cases however, where the text is longer than a single line. In these cases the complete text must be bracketed so the User-process knows when it may stop reading the reply (i.e. stop processing input on the control connection) and go do other things. This requires a special format on the first line to indicate that more than one line is coming, and another on the last line to designate it as the last. At least one of these must contain the appropriate reply code to indicate the state of the transaction. To satisfy all factions, it was decided that both the first and last line codes should be the same.
Thus the format for multi-line replies is that the first line will begin with the exact required reply code, followed immediately by a Hyphen, "-" (also known as Minus), followed by text. The last line will begin with the same code, followed immediately by Space <SP>, optionally some text, and the Telnet end-of-line code.
 For example:
 123-First line
 Second line
 234 A line beginning with numbers
 123 The last line"

ubuntu ftp doesn't seem to implement correctely this standard, or misunderstand the "-".

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.