1 --- a/include/linux/kobject.h
2 +++ b/include/linux/kobject.h
4 #define UEVENT_NUM_ENVP 32 /* number of env pointers */
5 #define UEVENT_BUFFER_SIZE 2048 /* buffer for the variables */
9 /* path to the userspace helper executed on an event */
10 extern char uevent_helper[];
12 @@ -246,6 +248,10 @@ int add_uevent_var(struct kobj_uevent_en
14 int kobject_action_type(const char *buf, size_t count,
15 enum kobject_action *type);
17 +int broadcast_uevent(struct sk_buff *skb, __u32 pid, __u32 group,
21 static inline int kobject_uevent(struct kobject *kobj,
22 enum kobject_action action)
23 @@ -262,6 +268,16 @@ static inline int add_uevent_var(struct
24 static inline int kobject_action_type(const char *buf, size_t count,
25 enum kobject_action *type)
28 +void kfree_skb(struct sk_buff *);
30 +static inline int broadcast_uevent(struct sk_buff *skb, __u32 pid, __u32 group,
39 #endif /* _KOBJECT_H_ */
40 --- a/lib/kobject_uevent.c
41 +++ b/lib/kobject_uevent.c
42 @@ -377,6 +377,43 @@ int add_uevent_var(struct kobj_uevent_en
43 EXPORT_SYMBOL_GPL(add_uevent_var);
45 #if defined(CONFIG_NET)
46 +int broadcast_uevent(struct sk_buff *skb, __u32 pid, __u32 group,
49 + struct uevent_sock *ue_sk;
52 + /* send netlink message */
53 + mutex_lock(&uevent_sock_mutex);
54 + list_for_each_entry(ue_sk, &uevent_sock_list, list) {
55 + struct sock *uevent_sock = ue_sk->sk;
56 + struct sk_buff *skb2;
58 + skb2 = skb_clone(skb, allocation);
62 + err = netlink_broadcast(uevent_sock, skb2, pid, group,
67 + mutex_unlock(&uevent_sock_mutex);
73 +int broadcast_uevent(struct sk_buff *skb, __u32 pid, __u32 group,
80 +EXPORT_SYMBOL_GPL(broadcast_uevent);
82 +#if defined(CONFIG_NET)
83 static int uevent_net_init(struct net *net)
85 struct uevent_sock *ue_sk;