From patchwork Sun Mar 19 17:11:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darrell Ball X-Patchwork-Id: 740726 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vmQbG33Hwz9s7f for ; Mon, 20 Mar 2017 04:11:22 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BIoGFmu1"; dkim-atps=neutral Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id C11499BA; Sun, 19 Mar 2017 17:11:20 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 379E78DC for ; Sun, 19 Mar 2017 17:11:19 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg0-f67.google.com (mail-pg0-f67.google.com [74.125.83.67]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 048D513C for ; Sun, 19 Mar 2017 17:11:18 +0000 (UTC) Received: by mail-pg0-f67.google.com with SMTP id b5so16475691pgg.1 for ; Sun, 19 Mar 2017 10:11:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=HAyfrih0PGqLngR6MUPkGbTHudpIN91bIaY1d2DdcK0=; b=BIoGFmu11MsvhwDSM+yAcHcNuf2GfX4JiqKfOqtYQmyFaIujVA1MHnjO1zhcK2ubA0 1WvszC7ffbd1MEtzmci4xdwwlmAL6h60PmBWjlbyiqzbv9x9KnGBW5DAS8IOdVOUV9Jp tqk0cHZeno3Z8jbq4nz6ZJXD1LN36AzwCnIwNCbboX2gSDjf2fV8yG2+9AiWJOuY+6UG NeJ5aSObaF4amevkEBVQxLTpQihL2q2p0eaLWQAjCHJ8HcbGVWhcHnQXcsOrBI+lwj3/ YI+ahqVJe4eGxpj1+lCeKeEPRalFx3roiXF6ruGQsUCxnNnMSBttu4234Ms9DsMN57Tb T4tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=HAyfrih0PGqLngR6MUPkGbTHudpIN91bIaY1d2DdcK0=; b=KVAdLmXpIDscUdvbsiYg1Y+ealw5k6wtlRQIF/e6sl6cPOTnL+s67VH2gYu4+9zB3o x0tB4XzjldKV5T1thqUCotaNCTT7yOFbvSDaBQFutuojRNqhftM4E112Sib4aG44y40Q C/nZrPwsYbo1MO3D0GZgT9QTRRBSLcEI2XLnlcwUgh3/fzrNf9x0AyaPf9LlRWySopR0 4oyK7dGhTohphXLf9xF+mGb6cwm81OUWFH+uhCW5u59WDiYlzv25dQW1JG7mJf48pcVJ JfqCO923og1ZSJR6P9VW5m5q1X8eQm94PJYFduwGcRsUSTEdJ+PF0JJWAIuODUZ9Mc1m m0+Q== X-Gm-Message-State: AFeK/H3TrkWjQWMNeXTa3CID6MKZOsa31FiT28N3nrf7zQiyHvGoQsIGvvfkJOnHYJU76A== X-Received: by 10.98.110.193 with SMTP id j184mr27660661pfc.228.1489943478635; Sun, 19 Mar 2017 10:11:18 -0700 (PDT) Received: from localhost.localdomain (c-24-4-8-103.hsd1.ca.comcast.net. [24.4.8.103]) by smtp.gmail.com with ESMTPSA id u69sm28164353pfg.121.2017.03.19.10.11.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 19 Mar 2017 10:11:18 -0700 (PDT) From: Darrell Ball To: dlu998@gmail.com, dev@openvswitch.org Date: Sun, 19 Mar 2017 10:11:09 -0700 Message-Id: <1489943469-42818-1-git-send-email-dlu998@gmail.com> X-Mailer: git-send-email 1.9.1 X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [patch_v1] ovs build: Fix memset with zero size warning. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org In file included from /usr/include/string.h:640:0, from ./lib/string.h:20, from /usr/include/netinet/icmp6.h:22, from ../lib/flow.h:21, from ../lib/flow.c:18: In function 'memset', inlined from 'flow_push_vlan_uninit' at ../lib/flow.c:2188:19: /usr/include/x86_64-linux-gnu/bits/string3.h:81:30: error: call to '__warn_memset_zero_len' declared with attribute warning: memset used with constant zero length parameter; this could be due to transposed parameters [-Werror] __warn_memset_zero_len (); ^ cc1: all warnings being treated as errors make[2]: *** [lib/flow.lo] Error 1 Fixes: f0fb825a3785 ("Add support for 802.1ad (QinQ tunneling)") Signed-off-by: Darrell Ball --- lib/flow.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/flow.c b/lib/flow.c index f628526..0a67455 100644 --- a/lib/flow.c +++ b/lib/flow.c @@ -2184,7 +2184,9 @@ flow_push_vlan_uninit(struct flow *flow, struct flow_wildcards *wc) { if (wc) { int n = flow_count_vlan_headers(flow); - memset(wc->masks.vlans, 0xff, sizeof(union flow_vlan_hdr) * n); + if (n) { + memset(wc->masks.vlans, 0xff, sizeof(union flow_vlan_hdr) * n); + } } memmove(&flow->vlans[1], &flow->vlans[0], sizeof(union flow_vlan_hdr) * (FLOW_MAX_VLAN_HEADERS - 1));