Skip to content

Commit

Permalink
datapath: test for netlink_set_err returning void
Browse files Browse the repository at this point in the history
In v2.6.33 netlink_set_err returns void. However, 1a50307ba182 ("netlink:
fix NETLINK_RECV_NO_ENOBUFS in netlink_set_err()") was backported and
included in v2.6.33.2 and in that and subsequent v2.6.33 stable releases
netlink_set_err returns an int.

It seems plausible that there are other backports floating around. So check
for netlink_set_err returning void rather than including compatibility code
based on the version of the kernel.

Signed-off-by: Simon Horman <[email protected]>
Acked-by: Pravin B Shelar <[email protected]>
  • Loading branch information
shorman-netronome authored and pshelar committed Jan 29, 2016
1 parent 025f69a commit 6dbd98e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_put_in_addr])
OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_find_nested])
OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_is_last])
OVS_GREP_IFELSE([$KSRC/include/linux/netlink.h], [void.*netlink_set_err],
[OVS_DEFINE([HAVE_VOID_NETLINK_SET_ERR])])
OVS_GREP_IFELSE([$KSRC/include/net/sctp/checksum.h], [sctp_compute_cksum])
Expand Down
2 changes: 1 addition & 1 deletion datapath/linux/compat/include/net/genetlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static inline int rpl_genl_unregister_family(struct genl_family *family)
static inline int genl_set_err(struct genl_family *family, struct net *net,
u32 portid, u32 group, int code)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
#ifdef HAVE_VOID_NETLINK_SET_ERR
netlink_set_err(net->genl_sock, portid, group, code);
return 0;
#else
Expand Down

0 comments on commit 6dbd98e

Please sign in to comment.