]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: pktgen: Fix interface flags printing
authorGavrilov Ilia <Ilia.Gavrilov@infotecs.ru>
Mon, 16 Oct 2023 14:08:59 +0000 (14:08 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Oct 2023 09:16:49 +0000 (11:16 +0200)
commitfb74be5e99f7780518b4c0fa50e21d0e9fb90640
treedc80c3eed40af2a06ca4fffb0a329531067e17ad
parent7ee82e80c2a6814168000927ec01876b89e46b0f
net: pktgen: Fix interface flags printing

commit 1d30162f35c7a73fc2f8cdcdcdbd690bedb99d1a upstream.

Device flags are displayed incorrectly:
1) The comparison (i == F_FLOW_SEQ) is always false, because F_FLOW_SEQ
is equal to (1 << FLOW_SEQ_SHIFT) == 2048, and the maximum value
of the 'i' variable is (NR_PKT_FLAG - 1) == 17. It should be compared
with FLOW_SEQ_SHIFT.

2) Similarly to the F_IPSEC flag.

3) Also add spaces to the print end of the string literal "spi:%u"
to prevent the output from merging with the flag that follows.

Found by InfoTeCS on behalf of Linux Verification Center
(linuxtesting.org) with SVACE.

Fixes: 99c6d3d20d62 ("pktgen: Remove brute-force printing of flags")
Signed-off-by: Gavrilov Ilia <Ilia.Gavrilov@infotecs.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/core/pktgen.c