On 10/26/23 11:41 AM, Nikolay Aleksandrov wrote:
Use netlink's NLA_POLICY_VALIDATE_FN() type for mode and primary/peer policy with custom validation functions to return better errors. This simplifies the logic a bit and relies on netlink's policy validation. We don't have to specify len because the type is NLA_U32 and attribute length is enforced by netlink. Suggested-by: Jiri Pirko <jiri@xxxxxxxxxxx> Signed-off-by: Nikolay Aleksandrov <razor@xxxxxxxxxxxxx>
Acked-by: Daniel Borkmann <daniel@xxxxxxxxxxxxx>
--- drivers/net/netkit.c | 66 +++++++++++++++----------------------------- 1 file changed, 22 insertions(+), 44 deletions(-)
Looks better indeed, shrinks code a bit, and passes the selftests, thanks for the suggestion! Thanks, Daniel