iproute2/devlink
Andrea Claudi 4fb98f0895 devlink: fix segfault on health command
devlink segfaults when using grace_period without reporter

$ devlink health set pci/0000:00:09.0 grace_period 3500
Segmentation fault

devlink is instead supposed to gracefully fail printing a warning
message

$ devlink health set pci/0000:00:09.0 grace_period 3500
Reporter's name is expected.

This happens because DL_OPT_HEALTH_REPORTER_NAME and
DL_OPT_HEALTH_REPORTER_GRACEFUL_PERIOD are both defined as BIT(27).
When dl_opts_put() parse options and grace_period is set, it erroneously
tries to set reporter name to null.

This is fixed simply shifting by 1 bit enumeration starting with
DL_OPT_HEALTH_REPORTER_GRACEFUL_PERIOD.

Fixes: b18d89195b ("devlink: Add devlink health set command")
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2019-09-04 12:01:19 -07:00
..
.gitignore devlink: ignore build result 2016-04-11 13:35:12 -07:00
Makefile iproute2: Installation errors without libmnl 2018-12-04 14:27:08 -08:00
devlink.c devlink: fix segfault on health command 2019-09-04 12:01:19 -07:00
mnlg.c devlink: mnlg: Catch returned error value of dumpit commands 2019-06-12 08:43:14 -07:00
mnlg.h add devlink tool 2016-03-27 10:57:15 -07:00