From mboxrd@z Thu Jan 1 00:00:00 1970 From: rahasij Date: Thu, 21 May 2020 17:29:25 -0700 (MST) Subject: [PATCH v4] net: tftp: Add client support for RFC 7440 In-Reply-To: <20200519192557.18075-1-rfried.dev@gmail.com> References: <20200519192557.18075-1-rfried.dev@gmail.com> Message-ID: <1590107365262-0.post@n7.nabble.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Ramon Fried-4 wrote > + if (strcmp((char *)pkt + i, "windowsize") == 0) { > + tftp_windowsize = > + simple_strtoul((char *)pkt + i + 11, > + NULL, 10); > + debug("windowsize = %s, %d\n", > + (char *)pkt + i + 11, tftp_windowsize); > + } > + > } > -- > 2.26.2 As per RFC2347, the option string is case insensitive. I fixed this for other options in following patch https://lists.denx.de/pipermail/u-boot/2020-May/412472.html Please use strcasecmp() instead of strcmp(). As per RFC7440, the value received from server should be less than or equal to the value proposed by client . This check should be added here, and error packet must be generated in case of failure. Above patch implements ERR pkt generation and should be applied first. -- Sent from: http://u-boot.10912.n7.nabble.com/