From patchwork Tue Nov 10 04:19:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 542129 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 DE6D31409F8 for ; Tue, 10 Nov 2015 15:19:21 +1100 (AEDT) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id B040710672; Mon, 9 Nov 2015 20:19:20 -0800 (PST) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v3.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id 244DC1066E for ; Mon, 9 Nov 2015 20:19:19 -0800 (PST) Received: from bar3.cudamail.com (localhost [127.0.0.1]) by mx3v3.cudamail.com (Postfix) with ESMTPS id 4B01F162F5D for ; Mon, 9 Nov 2015 21:19:18 -0700 (MST) X-ASG-Debug-ID: 1447129157-03dd7b32ea05e10001-byXFYA Received: from mx3-pf2.cudamail.com ([192.168.14.1]) by bar3.cudamail.com with ESMTP id NbYkEeQ5ybbFCxnp (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 09 Nov 2015 21:19:17 -0700 (MST) X-Barracuda-Envelope-From: blp@ovn.org X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.1 Received: from unknown (HELO relay4-d.mail.gandi.net) (217.70.183.196) by mx3-pf2.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 10 Nov 2015 04:19:11 -0000 Received-SPF: pass (mx3-pf2.cudamail.com: SPF record at ovn.org designates 217.70.183.196 as permitted sender) X-Barracuda-Apparent-Source-IP: 217.70.183.196 X-Barracuda-RBL-IP: 217.70.183.196 Received: from mfilter48-d.gandi.net (mfilter48-d.gandi.net [217.70.178.179]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id A4B7F17208B; Tue, 10 Nov 2015 05:19:08 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter48-d.gandi.net Received: from relay4-d.mail.gandi.net ([IPv6:::ffff:217.70.183.196]) by mfilter48-d.gandi.net (mfilter48-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id YJCHFz1yYSGl; Tue, 10 Nov 2015 05:19:07 +0100 (CET) X-Originating-IP: 173.228.112.197 Received: from ovn.org (173-228-112-197.dsl.dynamic.fusionbroadband.com [173.228.112.197]) (Authenticated sender: blp@ovn.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 314B5172090; Tue, 10 Nov 2015 05:19:05 +0100 (CET) Date: Mon, 9 Nov 2015 20:19:02 -0800 X-CudaMail-Envelope-Sender: blp@ovn.org From: Ben Pfaff To: YAMAMOTO Takashi X-CudaMail-MID: CM-V2-1108066254 X-CudaMail-DTE: 110915 X-CudaMail-Originating-IP: 217.70.183.196 Message-ID: <20151110041902.GC8509@ovn.org> X-ASG-Orig-Subj: [##CM-V2-1108066254##]Re: [ovs-dev] [PATCH 10/21] ofproto-macros.at: Add another strerror(0) value References: <1445228952-22445-1-git-send-email-yamamoto@midokura.com> <1445228952-22445-10-git-send-email-yamamoto@midokura.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1445228952-22445-10-git-send-email-yamamoto@midokura.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-GBUdb-Analysis: 0, 217.70.183.196, Ugly c=0.318533 p=-0.0909091 Source Normal X-MessageSniffer-Rules: 0-0-0-4996-c X-Barracuda-Connect: UNKNOWN[192.168.14.1] X-Barracuda-Start-Time: 1447129157 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.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=3.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.24263 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Cc: dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH 10/21] ofproto-macros.at: Add another strerror(0) value 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: , Errors-To: dev-bounces@openvswitch.org Sender: "dev" On Mon, Oct 19, 2015 at 01:29:01PM +0900, YAMAMOTO Takashi wrote: > On NetBSD, strerror(0) is "Undefined error: 0". > > Signed-off-by: YAMAMOTO Takashi > --- > tests/ofproto-macros.at | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/tests/ofproto-macros.at b/tests/ofproto-macros.at > index 94d7c86..368dade 100644 > --- a/tests/ofproto-macros.at > +++ b/tests/ofproto-macros.at > @@ -28,7 +28,8 @@ prt==1 { sub(/[ \t]*$/, ""); print $0 } > vconn_sub() { > sed ' > s/tcp:127.0.0.1:[0-9][0-9]*:/unix:/ > -s/No error/Success/ > +s/(No error)/(Success)/ > +s/(Undefined error: 0)/(Success)/ > ' > } Since we now have two different OSes that need special treatment here, it might be better to do something more uniform to avoid the special treatment. One idea would be to modify ovs_strerror() to always provide the same string for error 0. Another would be to modify vconn.c to avoid indicating any error when there is none, e.g.: diff --git a/lib/vconn.c b/lib/vconn.c index d835943..f50f3e8 100644 --- a/lib/vconn.c +++ b/lib/vconn.c @@ -683,7 +683,9 @@ do_send(struct vconn *vconn, struct ofpbuf *msg) } else { char *s = ofp_to_string(msg->data, msg->size, 1); retval = (vconn->vclass->send)(vconn, msg); - if (retval != EAGAIN) { + if (!retval) { + VLOG_DBG_RL(&ofmsg_rl, "%s: sent: %s", vconn->name, s); + } else if (retval != EAGAIN) { VLOG_DBG_RL(&ofmsg_rl, "%s: sent (%s): %s", vconn->name, ovs_strerror(retval), s); }