[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

tftpd failure

As prevoiusly mentioned, tftpd (and presumably tftp too) fails on ARM,
truncating the first two letters from the filename.  Futher
investigation reveals the problem:


struct  tftphdr {
        short   th_opcode;                      /* packet type */
        union {
                unsigned short  tu_block;       /* block # */
                short   tu_code;                /* error code */
                char    tu_stuff[1];            /* request packet stuff */
        } __attribute__ ((__packed__)) th_u;
        char    th_data[1];                     /* data or error string */
} __attribute__ ((__packed__));

This seems ok, unfortunately:

offsetof(struct tftphdr, th_u.tu_stuff) returns 4 - revealing why the
filename (in tu_stuff) has lost the first two letters.

Which unless someone knows better, seems to indicate a compiler bug.

gcc version 2.95.3 20010125 (prerelease)


 Peter Naulls - peter@erble.freeserve.co.uk
 Homepage - http://free.prohosting.com/~chocky/
 Java for RISC OS and ARM - http://www.java.riscos.org.uk/
 Debian Linux on RiscPCs - http://www.erble.freeserve.co.uk/

Reply to: