can: netlink: allow user to turn off unsupported features
authorVincent Mailhol <mailhol.vincent@wanadoo.fr>
Sun, 15 Aug 2021 03:32:42 +0000 (12:32 +0900)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 19 Aug 2021 13:07:03 +0000 (15:07 +0200)
commite43aaa0fefcec5c02b23cff2589ce4ecb2bfcb9e
tree7e9269189cba41dd35b64356dcce70baad130c18
parent6e86a1543c378f2e8837ad88f361b7bf606c80f7
can: netlink: allow user to turn off unsupported features

The sanity checks on the control modes will reject any request related
to an unsupported features, even turning it off.

Example on an interface which does not support CAN-FD:

$ ip link set can0 type can bitrate 500000 fd off
RTNETLINK answers: Operation not supported

This patch lets such command go through (but requests to turn on an
unsupported feature are, of course, still denied).

Link: https://lore.kernel.org/r/20210815033248.98111-2-mailhol.vincent@wanadoo.fr
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/dev/netlink.c