diff options
author | Andrew Goodbody <andrew.goodbody@linaro.org> | 2025-07-08 17:51:17 +0100 |
---|---|---|
committer | Jerome Forissier <jerome.forissier@linaro.org> | 2025-08-01 09:30:47 +0200 |
commit | c29c5ed2966425a14aab6794e739a78ab46178a5 (patch) | |
tree | 89147f6758090d92d555833eced628a2aacbd214 | |
parent | 31a8d2d34082ff6d1e2989912a373aed3f080fb6 (diff) |
net: Incorrect NOP macro used for test
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>
-rw-r--r-- | net/tcp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tcp.c b/net/tcp.c index 2635727f47d..8740150365f 100644 --- 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]; |