[PATCH 4/7] iplink_can: add the "restricted" option

Vincent Mailhol posted 7 patches 2 days, 6 hours ago
Re: [PATCH 4/7] iplink_can: add the "restricted" option
Posted by Stephen Hemminger 2 days, 5 hours ago
On Sat, 29 Nov 2025 16:29:09 +0100
Vincent Mailhol <mailhol@kernel.org> wrote:

> @@ -257,6 +259,9 @@ static int can_parse_opt(struct link_util *lu, int argc, char **argv,
>  				invarg("\"tdc-mode\" must be either of \"auto\", \"manual\" or \"off\"",
>  					*argv);
>  			}
> +		} else if (matches(*argv, "restricted") == 0) {
> +			NEXT_ARG();
> +			set_ctrlmode("restricted", *argv, &cm, CAN_CTRLMODE_RESTRICTED);
>  		} else if (matches(*argv, "restart") == 0) {
>  			__u32 val = 1;

Good example of iproute2 has banned use of matches. Because usage like the
(think of what happens when user was previously using 'r')