tftpd: tweak HP PA-RISC firmware bug compatibility
authorDenys Vlasenko <vda.linux@googlemail.com>
Thu, 4 Sep 2014 10:24:03 +0000 (12:24 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 4 Sep 2014 10:24:03 +0000 (12:24 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/tftp.c

index 8e3b0a2dcede43a10a455d499e27b6ba47bd01c7..7c0ee58d7d0475085ba856327acd4e57d44b6ee8 100644 (file)
@@ -117,8 +117,9 @@ struct globals {
        /* u16 TFTP_ERROR; u16 reason; both network-endian, then error text: */
        uint8_t error_pkt[4 + 32];
        struct passwd *pw;
-       /* used in tftpd_main(), a bit big for stack: */
-       char block_buf[TFTP_BLKSIZE_DEFAULT];
+       /* Used in tftpd_main() for initial packet */
+       /* Some HP PA-RISC firmware always sends fixed 516-byte requests */
+       char block_buf[516];
        char block_buf_tail[1];
 #if ENABLE_FEATURE_TFTP_PROGRESS_BAR
        off_t pos;
@@ -811,7 +812,7 @@ int tftpd_main(int argc UNUSED_PARAM, char **argv)
        ) {
                goto err;
        }
-       /* Some HP PA-RISC firmware always sends fixed 512-byte requests,
+       /* Some HP PA-RISC firmware always sends fixed 516-byte requests,
         * with trailing garbage.
         * Support that by not requiring NUL to be the last byte (see above).
         * To make strXYZ() ops safe, force NUL termination: