tftp: do not risk invoking Sorcerer's Apprentice syndrome
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 10 May 2009 21:27:43 +0000 (23:27 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 10 May 2009 21:27:43 +0000 (23:27 +0200)
examples/udhcp/simple.script: fix incorrect test for $1

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
examples/udhcp/simple.script
networking/tftp.c

index abf1b6f26a48d5174444d2c721dc72b43bdbf43c..40ee738225c79cbccd29f9f54b200aab25a9830d 100644 (file)
@@ -3,7 +3,7 @@
 
 RESOLV_CONF="/etc/resolv.conf"
 
-[ -n "$1" ] || echo "Error: should be called from udhcpc" && exit 1
+[ -n "$1" ] || { echo "Error: should be called from udhcpc"; exit 1; }
 
 NETMASK=""
 [ -n "$subnet" ] && NETMASK="netmask $subnet"
index 352037f1bae73fa3d2827da38179d018c3f8fe05..6cd3f69d37c4634c6bbef71779fff85ba1172445 100644 (file)
@@ -501,11 +501,14 @@ static int tftp_protocol(
                                }
                                continue; /* send ACK */
                        }
+/* Disabled to cope with servers with Sorcerer's Apprentice Syndrome */
+#if 0
                        if (recv_blk == (block_nr - 1)) {
                                /* Server lost our TFTP_ACK.  Resend it */
                                block_nr = recv_blk;
                                continue;
                        }
+#endif
                }
 
                if (CMD_PUT(option_mask32) && (opcode == TFTP_ACK)) {