Experimental Physics and Industrial Control System
Hi Dale,
Dale L. Brewe wrote:
I'm having a bit of an issue trying to get tornado 2.02 to boot from a
RAID network storage appliance (ReadyNAS from Infrant) running ProFTPD
v.1.2.9 under a version of Linux. The problem is that downloading the
boot image takes around 6-7 minutes. Downloading the script file happens
normally, in a couple of seconds.
This sounds like a known issue with the vxWorks bootrom code, which
closes its sockets in the wrong order. We came across this first with
the Solaris 9 FTP server, which derives from a different codebase than
the previous Solaris FTP servers and is less liberal in what it will accept.
There are two TCP sockets involved with an FTP file transfer, the
command socket and the data socket. The vxWorks FTP library allows
application code rather a lot of control over the data transfer process
since it wants to allow the data socket to be connected directly to some
code (such as the ld command) that can perform I/O directly on the
socket without having to buffer all the data coming through it. This
means that the library isn't able to completely enforce the protocol by
itself, and an application can cause problems.
An FTP client is supposed to close the data socket when it's finished
reading the data, and then close the command socket. Unfortunately the
vxWorks bootrom code does that in the wrong order, and thus doesn't
correctly follow the FTP protocol defined in RFC959. Older FTP servers
don't seem to mind this, but some newer servers will not look for a new
command on the command socket until the data socket has been closed
(this may be for security reasons).
The fix involves applying this patch (which applies to all BSPs) to your
target/config/all/bootConfig.c file, then rebuilding and flashing the
bootrom.
- Andrew
Index: bootConfig.c
===================================================================
RCS file: /home/phoebus/TORNADO5/cvsroot/config/all/bootConfig.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- bootConfig.c 12 Mar 2003 22:53:28 -0000 1.2
+++ bootConfig.c 22 Jan 2004 21:18:42 -0000 1.3
@@ -2492,11 +2492,11 @@
while ((read (fd, command, sizeof (command))) > 0);
+ close (fd);
if (bootFtp)
(void) ftpCommand (errFd, "QUIT",0,0,0,0,0,0);
}
- close (fd);
close (errFd);
return (OK);
@@ -2510,5 +2510,6 @@
while ((read (fd, command, sizeof (command))) > 0);
+ close (fd);
if (bootFtp)
{
@@ -2520,6 +2521,7 @@
{
char buf [100];
int errBytesRecv = fioRead (errFd, buf, sizeof (buf));
+ close (fd);
if (errBytesRecv > 0)
{
@@ -2530,7 +2532,6 @@
}
}
- close (fd);
close (errFd);
return (ERROR);
- Replies:
- Re: vxWorks and ProFTPD Dale L. Brewe
- References:
- vxWorks and ProFTPD Dale L. Brewe
- Navigate by Date:
- Prev:
vxWorks and ProFTPD Dale L. Brewe
- Next:
RE: vxWorks and ProFTPD Paul Sichta
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
<2006>
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
vxWorks and ProFTPD Dale L. Brewe
- Next:
Re: vxWorks and ProFTPD Dale L. Brewe
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
<2006>
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024