[NET]: Support multiple network namespaces with netlink
[deliverable/linux.git] / lib / kobject_uevent.c
index 6a80c784a8fb91f43c6d5f3f833df320be3b2cbb..e06a8dcec0f04ce9e566901be3fa52c786a74e41 100644 (file)
 #define BUFFER_SIZE    2048    /* buffer for the variables */
 #define NUM_ENVP       32      /* number of env pointers */
 
-#if defined(CONFIG_HOTPLUG)
-u64 uevent_seqnum;
-char uevent_helper[UEVENT_HELPER_PATH_LEN] = "/sbin/hotplug";
-static DEFINE_SPINLOCK(sequence_lock);
-#if defined(CONFIG_NET)
-static struct sock *uevent_sock;
-#endif
-
 /* the strings here must match the enum in include/linux/kobject.h */
 const char *kobject_actions[] = {
        "add",
@@ -43,6 +35,14 @@ const char *kobject_actions[] = {
        "offline",
 };
 
+#if defined(CONFIG_HOTPLUG)
+u64 uevent_seqnum;
+char uevent_helper[UEVENT_HELPER_PATH_LEN] = "/sbin/hotplug";
+static DEFINE_SPINLOCK(sequence_lock);
+#if defined(CONFIG_NET)
+static struct sock *uevent_sock;
+#endif
+
 /**
  * kobject_uevent_env - send an uevent with environmental data
  *
@@ -280,9 +280,8 @@ EXPORT_SYMBOL_GPL(add_uevent_var);
 #if defined(CONFIG_NET)
 static int __init kobject_uevent_init(void)
 {
-       uevent_sock = netlink_kernel_create(NETLINK_KOBJECT_UEVENT, 1, NULL,
-                                           NULL, THIS_MODULE);
-
+       uevent_sock = netlink_kernel_create(&init_net, NETLINK_KOBJECT_UEVENT,
+                                           1, NULL, NULL, THIS_MODULE);
        if (!uevent_sock) {
                printk(KERN_ERR
                       "kobject_uevent: unable to create netlink socket!\n");
This page took 0.025985 seconds and 5 git commands to generate.