aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-11-19 09:19:37 -0500
committerDavid S. Miller <davem@davemloft.net>2013-11-19 16:39:06 -0500
commit62b68e99faa802352e9cb2ae91adecd8dfddf1b8 (patch)
treea76d8342a57b8451bef657919201c76a5333f1f1 /include/net
parentc2ebb908469d507ff400dad94efc755e6c799672 (diff)
genetlink: add and use genl_set_err()
Add a static inline to generic netlink to wrap netlink_set_err() to make it easier to use here - use it in openvswitch (the only generic netlink user of netlink_set_err()). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/genetlink.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index d8a8b1fd96c4..11ac77f6180c 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -351,5 +351,19 @@ static inline struct sk_buff *genlmsg_new(size_t payload, gfp_t flags)
351 return nlmsg_new(genlmsg_total_size(payload), flags); 351 return nlmsg_new(genlmsg_total_size(payload), flags);
352} 352}
353 353
354/**
355 * genl_set_err - report error to genetlink broadcast listeners
356 * @net: the network namespace to report the error to
357 * @portid: the PORTID of a process that we want to skip (if any)
358 * @group: the broadcast group that will notice the error
359 * @code: error code, must be negative (as usual in kernelspace)
360 *
361 * This function returns the number of broadcast listeners that have set the
362 * NETLINK_RECV_NO_ENOBUFS socket option.
363 */
364static inline int genl_set_err(struct net *net, u32 portid, u32 group, int code)
365{
366 return netlink_set_err(net->genl_sock, portid, group, code);
367}
354 368
355#endif /* __NET_GENERIC_NETLINK_H */ 369#endif /* __NET_GENERIC_NETLINK_H */