From patchwork Wed Feb 3 08:07:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramon Fried X-Patchwork-Id: 1435174 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=LrDcECBc; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DVvPj6YzBz9tkb for ; Wed, 3 Feb 2021 19:05:45 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DD01982731; Wed, 3 Feb 2021 09:05:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LrDcECBc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D9F4A82753; Wed, 3 Feb 2021 09:05:37 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 19E0582730 for ; Wed, 3 Feb 2021 09:05:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rfried.dev@gmail.com Received: by mail-wr1-x42e.google.com with SMTP id u14so1207344wri.3 for ; Wed, 03 Feb 2021 00:05:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=bkGhRyDE1ssy9w7kd4U2dgQHb1cX9AEW39dZsP9y4Ag=; b=LrDcECBc3ZCQQHsAgZgqRFSG8cRs2oXVmB9Gq8f+gtYiQ2wLPXTjvV2e6x7JuKjyQs t67DDyiOurJudk4/H+I2wcz/XG+NSDsUwxM3c9tHqVXc3A5yOI5SutTdmGq60rGUxEJH 18D9B50hZPDkwHUhsqiLB9TEVAsjiMxjGVrnLGuDVPS9onuz3vlFPi2jNlNEXsr3QITf 0Az3CmmED96JPlI8VhcuGowjUhERFeyvm0akRcoq6S0BOa7bfRfxZ0SFriSEXX2EoObN 7ZfrZ4mqhx2LEqH7M5ZKFaOHKZbd6Rs++hgVxEUD8pyfuHDqyPk/3JN/iX2+D8MGDTi1 TVIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=bkGhRyDE1ssy9w7kd4U2dgQHb1cX9AEW39dZsP9y4Ag=; b=nH5+KAiprZ0NvylfYZ0jp8QZLRzA329tqAu5y3Bv6taEo0mpzqrIrWNuRZ0N/Lmwao 3TPsj5qbmVRwIAZSkFPjrwszbV8XwMtY0Q+zLN900RJxpMnzsYus6T4RuhNXVqwIBOiD W6f2UY7nYGqH7NJhVF5DOGYdxszELcn2Mz2jm4DUBjlCCrebm16XXhb0TZQESea5chXL i6aU4U2tjreE4wxhL4Yr7i44RXuL41JgdXFp1atYsJmc95Sri57UhNFM+2nmRbuMHwqs YBkA6LnqRxM7s8y4oHBZzdgi++esz24BHlWBQ2X+SQD+HmiBkRglWOxV27yZfzCADH2g lp8A== X-Gm-Message-State: AOAM533E6+taDfyT96kC7pSflRe1AgIiV+GonHQxFzGnNBMiA/m0hDeq Ag6Np5XOJ2Nz5hRSkiqliQk= X-Google-Smtp-Source: ABdhPJy2svDlRCTJwOEq5cWXgdxvgU+aj18CtlM0wrgGfXhmT8qXrnFbC3ZWpaUpCU1TiNDZkXKLmg== X-Received: by 2002:adf:f782:: with SMTP id q2mr2032197wrp.181.1612339534644; Wed, 03 Feb 2021 00:05:34 -0800 (PST) Received: from lotus.nr.ent (82.166.25.98.fix.netvision.net.il. [82.166.25.98]) by smtp.gmail.com with ESMTPSA id y18sm2187095wrt.19.2021.02.03.00.05.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 00:05:33 -0800 (PST) From: Ramon Fried To: joe.hershberger@ni.com, suneelglinux@gmail.com Cc: u-boot@lists.denx.de, Ramon Fried Subject: [PATCH] net: tftp: Avoid sending extra ack on completion Date: Wed, 3 Feb 2021 10:07:50 +0200 Message-Id: <20210203080750.18867-1-rfried.dev@gmail.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean in tftpboot, if ack was already sent previously for this packet, don't send again. Fixes: cc6b87ecaa96 ("net: tftp: Add client support for RFC 7440") Reported-by: Suneel Garapati Signed-off-by: Ramon Fried --- net/tftp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/tftp.c b/net/tftp.c index 03079ded34..1111834f71 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -678,7 +678,8 @@ static void tftp_handler(uchar *pkt, unsigned dest, struct in_addr sip, } if (len < tftp_block_size) { - tftp_send(); + if (tftp_cur_block != tftp_next_ack) + tftp_send(); tftp_complete(); } break;