Browse Source

netlink: Move netlink attribute parsing support to lib

Netlink attribute parsing may be used even if CONFIG_NET is not set.
Move it from net/netlink to lib and control its inclusion based on the new
config symbol CONFIG_NLATTR, which is selected by CONFIG_NET.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Geert Uytterhoeven 16 years ago
parent
commit
e9cc8bddae
5 changed files with 10 additions and 1 deletions
  1. 6 0
      lib/Kconfig
  2. 2 0
      lib/Makefile
  3. 0 0
      lib/nlattr.c
  4. 1 0
      net/Kconfig
  5. 1 1
      net/netlink/Makefile

+ 6 - 0
lib/Kconfig

@@ -174,4 +174,10 @@ config DISABLE_OBSOLETE_CPUMASK_FUNCTIONS
        bool "Disable obsolete cpumask functions" if DEBUG_PER_CPU_MAPS
        bool "Disable obsolete cpumask functions" if DEBUG_PER_CPU_MAPS
        depends on EXPERIMENTAL && BROKEN
        depends on EXPERIMENTAL && BROKEN
 
 
+#
+# Netlink attribute parsing support is select'ed if needed
+#
+config NLATTR
+	bool
+
 endmenu
 endmenu

+ 2 - 0
lib/Makefile

@@ -84,6 +84,8 @@ obj-$(CONFIG_HAVE_ARCH_TRACEHOOK) += syscall.o
 
 
 obj-$(CONFIG_DYNAMIC_PRINTK_DEBUG) += dynamic_printk.o
 obj-$(CONFIG_DYNAMIC_PRINTK_DEBUG) += dynamic_printk.o
 
 
+obj-$(CONFIG_NLATTR) += nlattr.o
+
 hostprogs-y	:= gen_crc32table
 hostprogs-y	:= gen_crc32table
 clean-files	:= crc32table.h
 clean-files	:= crc32table.h
 
 

+ 0 - 0
net/netlink/attr.c → lib/nlattr.c


+ 1 - 0
net/Kconfig

@@ -4,6 +4,7 @@
 
 
 menuconfig NET
 menuconfig NET
 	bool "Networking support"
 	bool "Networking support"
+	select NLATTR
 	---help---
 	---help---
 	  Unless you really know what you are doing, you should say Y here.
 	  Unless you really know what you are doing, you should say Y here.
 	  The reason is that some programs need kernel networking support even
 	  The reason is that some programs need kernel networking support even

+ 1 - 1
net/netlink/Makefile

@@ -2,4 +2,4 @@
 # Makefile for the netlink driver.
 # Makefile for the netlink driver.
 #
 #
 
 
-obj-y  				:= af_netlink.o attr.o genetlink.o
+obj-y  				:= af_netlink.o genetlink.o