From patchwork Fri Nov 27 06:07:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 549306 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (unknown [IPv6:2600:3c00::f03c:91ff:fe6e:bdf7]) by ozlabs.org (Postfix) with ESMTP id 89B671402D4 for ; Fri, 27 Nov 2015 17:07:51 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b=V2aRqZnW; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 8EE6310DC8; Thu, 26 Nov 2015 22:07:50 -0800 (PST) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e3.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 35E1110DC7 for ; Thu, 26 Nov 2015 22:07:50 -0800 (PST) Received: from bar2.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id B62814201AE for ; Thu, 26 Nov 2015 23:07:49 -0700 (MST) X-ASG-Debug-ID: 1448604469-03dc530be11d6c0001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar2.cudamail.com with ESMTP id e2SzVXSq64RYaqqK (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 26 Nov 2015 23:07:49 -0700 (MST) X-Barracuda-Envelope-From: simon.horman@netronome.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO mail-pa0-f53.google.com) (209.85.220.53) by mx1-pf1.cudamail.com with ESMTPS (RC4-SHA encrypted); 27 Nov 2015 06:07:48 -0000 Received-SPF: none (mx1-pf1.cudamail.com: domain at netronome.com does not designate permitted sender hosts) X-Barracuda-RBL-Trusted-Forwarder: 209.85.220.53 Received: by padhx2 with SMTP id hx2so105176964pad.1 for ; Thu, 26 Nov 2015 22:07:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0jsn0btauEL/qjQl/xOLNVlc0mJm5Ch8FvgK+Tobeoo=; b=V2aRqZnWU+1kkOAI0GLkTs7wCac9cbNrJ0YDbES8JwD2yuBircqibL2kkFOaXbsc4i WAL5AhBn7W62pnxNhOVg8/daHCGwza+Wynj2dIMHy3wlbTT7+LmwYuLHMNTmXMXXijSh 3wfDei442TIsDS1j5+d4mIqaj01J0YO9YzZEgNmVDFtCUXFd9uWrcXONwekkEOXBIjI9 /HTkbgLv0WGwFp3bYoM56fQxxnxyDA0HlP5LCEjIT1lpObL2Smwmfm6PGTWfm/BLfPyH RBCUBPbkZgSOaLzlVZnrk4+mrvRUHVwX6nJLwrTpFFOM6lz327/ItDadxWqNUlASbBn+ H4Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0jsn0btauEL/qjQl/xOLNVlc0mJm5Ch8FvgK+Tobeoo=; b=gJolV1V3nJBeMFjo7BZG8gmg1+AE3ntEfFNIC/lmlobhg7EDYvgFTG3biMhsiLYcTO Fs2FDv2MgoCD7Zvf73q73q7jgZa9xay3ZvXEsIkv/3z8kS8/5+x9+toB3RqxaKYRWyo/ bjcyDFTUlBKfor80UsSGSUWpjVFz+AciUXnhCtn/gb8iJVXd/2lRTMNtenCOUIo8DTDb ZsjOAj7rJbhs7QxR+TaNPKENxE3KUFNu3MdfCXHzg22IQ9VrtqHum8sstg69gVkA/j63 8lUJ4VnAgo9EfR4+MQAKY8btk2e8kPQfsPQMKypeiLs1pCr9oM3iPj3vU9LmelKHwTnq Fugw== X-Gm-Message-State: ALoCoQkfryEvfxlDKHEnE9YjVhzOsHS/m7dnmIv0NR2rxmZjAAGVOOq3wqpkoadBCzxcuB1Dlrfr X-Received: by 10.66.243.3 with SMTP id wu3mr65423648pac.135.1448604468171; Thu, 26 Nov 2015 22:07:48 -0800 (PST) Received: from reginn.isobedori.kobe.vergenet.net (p5254-ipbfp1403kobeminato.hyogo.ocn.ne.jp. [114.152.48.254]) by smtp.gmail.com with ESMTPSA id v2sm31182899pfi.44.2015.11.26.22.07.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Nov 2015 22:07:46 -0800 (PST) X-CudaMail-Envelope-Sender: simon.horman@netronome.com X-Barracuda-Apparent-Source-IP: 114.152.48.254 From: Simon Horman To: dev@openvswitch.org, Pravin B Shelar X-CudaMail-MID: CM-E1-1125070005 X-CudaMail-DTE: 112615 X-CudaMail-Originating-IP: 209.85.220.53 Date: Fri, 27 Nov 2015 15:07:23 +0900 X-ASG-Orig-Subj: [##CM-E1-1125070005##][PATCH 2/2] datapath: test for netlink_set_err returning void Message-Id: <1448604443-12224-3-git-send-email-simon.horman@netronome.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1448604443-12224-1-git-send-email-simon.horman@netronome.com> References: <1448604443-12224-1-git-send-email-simon.horman@netronome.com> X-GBUdb-Analysis: 0, 209.85.220.53, Ugly c=0.44763 p=-0.61039 Source Normal X-MessageSniffer-Rules: 0-0-0-7529-c X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1448604469 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using per-user scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_SC5_MJ1963, DKIM_SIGNED, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.24761 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Cc: Simon Horman Subject: [ovs-dev] [PATCH 2/2] datapath: test for netlink_set_err returning void X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" 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 --- * Also applicable to branch-2.4, branch-2.3 and branch-2.2. I can provide backports if that would be useful. --- .travis.yml | 1 + acinclude.m4 | 2 ++ datapath/linux/compat/include/net/genetlink.h | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 141359b76c1e..422a6bd30909 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,6 +33,7 @@ env: - KERNEL=3.4.110 - KERNEL=3.2.72 - KERNEL=2.6.33.20 + - KERNEL=2.6.33.1 - KERNEL=2.6.32.68 script: ./.travis/build.sh $OPTS diff --git a/acinclude.m4 b/acinclude.m4 index e4846d90af37..fba9e70b47d1 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -431,6 +431,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]) diff --git a/datapath/linux/compat/include/net/genetlink.h b/datapath/linux/compat/include/net/genetlink.h index cf89d4c239e2..2830fa3767c8 100644 --- a/datapath/linux/compat/include/net/genetlink.h +++ b/datapath/linux/compat/include/net/genetlink.h @@ -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