]> git.ipfire.org Git - thirdparty/iproute2.git/commit
bridge: catch invalid stp state
authorStephen Hemminger <stephen@networkplumber.org>
Mon, 7 Oct 2024 16:33:48 +0000 (09:33 -0700)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 7 Oct 2024 16:33:48 +0000 (09:33 -0700)
commitf4b86f752d3c38d682fc1a5c55c67c8006c23800
tree7b59f3d4541b741f483366a0566d01077a66dd14
parentb32ac38cc49d377715f28b58cbeeb4086cbb9f7b
bridge: catch invalid stp state

The stp state parsing was putting result in an __u8 which
would mean that check for invalid string was never happening.

Caught by enabling -Wextra:
    CC       mst.o
mst.c: In function ‘mst_set’:
mst.c:217:27: warning: comparison is always false due to limited range of data type [-Wtype-limits]
  217 |                 if (state == -1) {

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
bridge/mst.c