]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
net: Incorrect NOP macro used for test
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Tue, 8 Jul 2025 16:51:17 +0000 (17:51 +0100)
committerJerome Forissier <jerome.forissier@linaro.org>
Fri, 1 Aug 2025 07:30:47 +0000 (09:30 +0200)
In tcp_parse_options the uchar p[0] is attempted to test for a match
with the 32bit macro TCP_0_NOP which can never be true. Instead test
against the 8bit macro TCP_1_NOP.

This issue found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
net/tcp.c

index 2635727f47de6589022470f89faf9d3acf52bf22..8740150365fb9c9c50e433bd1fad375053a540cb 100644 (file)
--- a/net/tcp.c
+++ b/net/tcp.c
@@ -804,7 +804,7 @@ void tcp_parse_options(struct tcp_stream *tcp, uchar *o, int o_len)
                }
 
                /* Process optional NOPs */
-               if (p[0] == TCP_O_NOP)
+               if (p[0] == TCP_1_NOP)
                        p++;
                else
                        p += p[1];