aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlink/genetlink.c
diff options
context:
space:
mode:
authorPravin B Shelar <pshelar@nicira.com>2011-11-10 22:14:37 -0500
committerJesse Gross <jesse@nicira.com>2011-12-03 12:35:05 -0500
commit263ba61d3b19508dfb003c215ec5d23f882b4f87 (patch)
tree1f00fe8aeaff938b6e6706d145f761c5990fc28e /net/netlink/genetlink.c
parent340e8dc1fb4032b6c8334c9bff20b2aec42ecfd8 (diff)
genetlink: Add genl_notify()
Open vSwitch uses Generic Netlink interface for communication between userspace and kernel module. genl_notify() is used for sending notification back to userspace. genl_notify() is analogous to rtnl_notify() but uses genl_sock instead of rtnl. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'net/netlink/genetlink.c')
-rw-r--r--net/netlink/genetlink.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index 482fa571b4ee..8a36599d3555 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -946,3 +946,16 @@ int genlmsg_multicast_allns(struct sk_buff *skb, u32 pid, unsigned int group,
946 return genlmsg_mcast(skb, pid, group, flags); 946 return genlmsg_mcast(skb, pid, group, flags);
947} 947}
948EXPORT_SYMBOL(genlmsg_multicast_allns); 948EXPORT_SYMBOL(genlmsg_multicast_allns);
949
950void genl_notify(struct sk_buff *skb, struct net *net, u32 pid, u32 group,
951 struct nlmsghdr *nlh, gfp_t flags)
952{
953 struct sock *sk = net->genl_sock;
954 int report = 0;
955
956 if (nlh)
957 report = nlmsg_report(nlh);
958
959 nlmsg_notify(sk, skb, pid, group, report, flags);
960}
961EXPORT_SYMBOL(genl_notify);