[Solved] Failed to set attribute: Invalid input data or parameter

Arm64 swconfig failed to configure VLAN

Failed to set attribute: invalid input data or parameter

Kernel version: linux-5.20.26
phenomenon:

[email protected]:/usr/lib# swconfig dev switch0 vlan 2 set ports "1 2 3"
Failed to set attribute: Invalid input data or parameter

Ref:
https://forum.openwrt.org/t/ath79-kernel-5-4-swconfig-libnl-tiny-issue/50689
https://github.com/MartB/openwrt/commit/df051318503ff41c6214fa845e447dcfc5d1a1d8
Reason: The problem with libnl-tiny can be solved by using libnl-3 instead

--- a/package/network/config/swconfig/Makefile
+++ b/package/network/config/swconfig/Makefile
@@ -14,27 +14,26 @@ PKG_MAINTAINER:=Felix Fietkau <[email protected]>
 PKG_LICENSE:=GPL-2.0
 
 include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/kernel.mk
 
 define Package/swconfig
   SECTION:=base
   CATEGORY:=Base system
-  DEPENDS:=+libuci +libnl-tiny
+  DEPENDS:=+libuci +libnl
   TITLE:=Switch configuration utility
 endef
 
 TARGET_CPPFLAGS := \
        -D_GNU_SOURCE \
-       -I$(STAGING_DIR)/usr/include/libnl-tiny \
+       -I$(STAGING_DIR)/usr/include/libnl3\
+       -I$(LINUX_DIR)/include \
        -I$(PKG_BUILD_DIR) \
-       $(TARGET_CPPFLAGS) \
-       -I$(LINUX_DIR)/user_headers/include
+       $(TARGET_CPPFLAGS)
 
 define Build/Compile
        CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
        $(MAKE) -C $(PKG_BUILD_DIR) \
                $(TARGET_CONFIGURE_OPTS) \
-               LIBS="$(TARGET_LDFLAGS) -lnl-tiny -lm -luci -lubox"
+               LIBS="-L$(STAGING_DIR)/usr/lib -lnl-genl-3 -lnl-3 -lm -luci -lubox"
 endef


Read More: