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>
This commit is contained in:
Andrew Goodbody
2025-08-01 09:30:47 +02:00
committed by Jerome Forissier
parent 31a8d2d340
commit c29c5ed296
+1 -1
View File
@@ -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];