kernel: swconfig: make compatible with kernel 5.2
authorMathias Kresin <dev@kresin.me>
Thu, 18 Jul 2019 08:29:08 +0000 (10:29 +0200)
committerMathias Kresin <dev@kresin.me>
Sat, 20 Jul 2019 21:49:53 +0000 (23:49 +0200)
commit3a772ee231e4b4c2c537d8d541f001b5242b9c35
tree0b356ea75ae80cad6d9b740f32fcd85ee5727574
parentdad19154be11f94b3f1e133fab736ae7bf2c411c
kernel: swconfig: make compatible with kernel 5.2

Since kernel 5.2 within netlink messages the NLA_F_NESTED nested flag is
validated. But swconfig/swlib doesn't set the flag for
SWITCH_ATTR_OP_VALUE_PORTS related netlink messages and assigning ports
to vlans via

  swconfig dev switch0 vlan 1 set ports '0 1 2 3 4 6t'

Errors put with "Failed to set attribute: Invalid input data or
parameter".

Relax the validation rules and use the deprecated functions, to use the
same level of validation as it was till kernel 5.1. Depending on who has
swconfig related netlink messages implemented, there might be more
broken tools out there and we should keep backward compatibility if
possible.

Signed-off-by: Mathias Kresin <dev@kresin.me>
target/linux/generic/files/drivers/net/phy/swconfig.c