From patchwork Tue Oct 18 12:25:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi YAMAMOTO X-Patchwork-Id: 683678 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3syvS64Dxyz9s3s for ; Tue, 18 Oct 2016 23:25:58 +1100 (AEDT) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 2067610276; Tue, 18 Oct 2016 05:25:52 -0700 (PDT) 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 7F8ED10237 for ; Tue, 18 Oct 2016 05:25:50 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id B9578420183 for ; Tue, 18 Oct 2016 06:25:49 -0600 (MDT) X-ASG-Debug-ID: 1476793549-09eadd6af26faf0001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar5.cudamail.com with ESMTP id LDwICeZreKsl01nb (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 18 Oct 2016 06:25:49 -0600 (MDT) X-Barracuda-Envelope-From: yamamoto@ovn.org X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO relay4-d.mail.gandi.net) (217.70.183.196) by mx1-pf1.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 18 Oct 2016 12:25:48 -0000 Received-SPF: pass (mx1-pf1.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 mfilter14-d.gandi.net (mfilter14-d.gandi.net [217.70.178.142]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id 490F7172110; Tue, 18 Oct 2016 14:25:47 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter14-d.gandi.net Received: from relay4-d.mail.gandi.net ([IPv6:::ffff:217.70.183.196]) by mfilter14-d.gandi.net (mfilter14-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id Umd7NUY9EZJA; Tue, 18 Oct 2016 14:25:45 +0200 (CEST) X-Originating-IP: 118.21.144.234 Received: from localhost.localdomain (i118-21-144-234.s30.a048.ap.plala.or.jp [118.21.144.234]) (Authenticated sender: yamamoto@ovn.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 1EE391720D9; Tue, 18 Oct 2016 14:25:43 +0200 (CEST) X-CudaMail-Envelope-Sender: yamamoto@ovn.org From: YAMAMOTO Takashi To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-E1-1017011760 X-CudaMail-DTE: 101816 X-CudaMail-Originating-IP: 217.70.183.196 Date: Tue, 18 Oct 2016 21:25:25 +0900 X-ASG-Orig-Subj: [##CM-E1-1017011760##][PATCH 2/3] ovn.at: Avoid using "printf -v" Message-Id: <1476793526-5303-2-git-send-email-yamamoto@ovn.org> X-Mailer: git-send-email 2.5.4 (Apple Git-61) In-Reply-To: <1476793526-5303-1-git-send-email-yamamoto@ovn.org> References: <1476793526-5303-1-git-send-email-yamamoto@ovn.org> X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1476793549 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Cc: YAMAMOTO Takashi Subject: [ovs-dev] [PATCH 2/3] ovn.at: Avoid using "printf -v" 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" It seems like a non-portable bash extension. Signed-off-by: YAMAMOTO Takashi Acked-by: Ben Pfaff --- tests/ovn.at | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ovn.at b/tests/ovn.at index caf9f98..da0291f 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -3618,8 +3618,8 @@ test_dhcp() { # (which is 272 in our case) + 8 (padding bytes) + (expected_dhcp_opts / 2) ip_len=`expr 280 + ${#expected_dhcp_opts} / 2` udp_len=`expr $ip_len - 20` - printf -v ip_len "%x" $ip_len - printf -v udp_len "%x" $udp_len + ip_len=$(printf "%x" $ip_len) + udp_len=$(printf "%x" $udp_len) # $ip_len var will be in 3 digits i.e 134. So adding a '0' before $ip_len local reply=${src_mac}${srv_mac}080045100${ip_len}000000008011XXXX${srv_ip}${offer_ip} # udp header and dhcp header.