Re: [PATCH bpf-next 1/4] netkit: Add option for scrubbing skb meta data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu,  3 Oct 2024 20:03:17 +0200 Daniel Borkmann wrote:
> +static int netkit_check_scrub(int scrub, struct nlattr *tb,
> +			      struct netlink_ext_ack *extack)
> +{
> +	switch (scrub) {
> +	case NETKIT_SCRUB_DEFAULT:
> +	case NETKIT_SCRUB_NONE:
> +		return 0;
> +	default:
> +		NL_SET_ERR_MSG_ATTR(extack, tb,
> +				    "Provided device scrub setting can only be default/none");
> +		return -EINVAL;
> +	}
> +}

Set the parsing policy to NLA_POLICY_MAX(NLA_U32, NETKIT_SCRUB_NONE)
and delete this open coded checking, please.




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux