From: Andrew Morton lib/lib.a(kobject_uevent.o)(.text+0x25f): In function `kobject_uevent': : undefined reference to `__alloc_skb' lib/lib.a(kobject_uevent.o)(.text+0x2a1): In function `kobject_uevent': : undefined reference to `skb_over_panic' lib/lib.a(kobject_uevent.o)(.text+0x31d): In function `kobject_uevent': : undefined reference to `skb_over_panic' lib/lib.a(kobject_uevent.o)(.text+0x356): In function `kobject_uevent': : undefined reference to `netlink_broadcast' lib/lib.a(kobject_uevent.o)(.init.text+0x9): In function `kobject_uevent_init': : undefined reference to `netlink_kernel_create' make: *** [.tmp_vmlinux1] Error 1 Netlink is unconditionally enabled if CONFIG_NET, so that's OK. kobject_uevent.o is compiled even if !CONFIG_HOTPLUG, which is lazy. Let's compound the sin. Cc: Greg KH Signed-off-by: Andrew Morton --- include/linux/kobject.h | 2 +- kernel/ksysfs.c | 3 +++ lib/kobject_uevent.c | 4 +--- 3 files changed, 5 insertions(+), 4 deletions(-) diff -puN lib/kobject_uevent.c~kobject_uevent-config_netn-fix lib/kobject_uevent.c --- devel/lib/kobject_uevent.c~kobject_uevent-config_netn-fix 2005-11-22 23:22:56.000000000 -0800 +++ devel-akpm/lib/kobject_uevent.c 2005-11-22 23:36:01.000000000 -0800 @@ -25,9 +25,7 @@ #define BUFFER_SIZE 1024 /* buffer for the variables */ #define NUM_ENVP 32 /* number of env pointers */ -#if defined(CONFIG_HOTPLUG) -char uevent_helper[UEVENT_HELPER_PATH_LEN] = "/sbin/hotplug"; -u64 uevent_seqnum; +#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) static DEFINE_SPINLOCK(sequence_lock); static struct sock *uevent_sock; diff -puN include/linux/kobject.h~kobject_uevent-config_netn-fix include/linux/kobject.h --- devel/include/linux/kobject.h~kobject_uevent-config_netn-fix 2005-11-22 23:22:56.000000000 -0800 +++ devel-akpm/include/linux/kobject.h 2005-11-22 23:23:14.000000000 -0800 @@ -253,7 +253,7 @@ struct subsys_attribute { extern int subsys_create_file(struct subsystem * , struct subsys_attribute *); extern void subsys_remove_file(struct subsystem * , struct subsys_attribute *); -#ifdef CONFIG_HOTPLUG +#if defined(CONFIG_HOTPLUG) & defined(CONFIG_NET) void kobject_uevent(struct kobject *kobj, enum kobject_action action); int add_uevent_var(char **envp, int num_envp, int *cur_index, diff -puN kernel/ksysfs.c~kobject_uevent-config_netn-fix kernel/ksysfs.c --- devel/kernel/ksysfs.c~kobject_uevent-config_netn-fix 2005-11-22 23:32:52.000000000 -0800 +++ devel-akpm/kernel/ksysfs.c 2005-11-22 23:35:58.000000000 -0800 @@ -15,6 +15,9 @@ #include #include +u64 uevent_seqnum; +char uevent_helper[UEVENT_HELPER_PATH_LEN] = "/sbin/hotplug"; + #define KERNEL_ATTR_RO(_name) \ static struct subsys_attribute _name##_attr = __ATTR_RO(_name) _