From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DB2A5A04E7; Sun, 29 Nov 2020 18:55:58 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 841D1C9B8; Sun, 29 Nov 2020 18:55:04 +0100 (CET) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by dpdk.org (Postfix) with ESMTP id CB7DBC938 for ; Sun, 29 Nov 2020 18:54:56 +0100 (CET) Received: by mail-pl1-f193.google.com with SMTP id r2so5188558pls.3 for ; Sun, 29 Nov 2020 09:54:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EkhG6AFxavZ5abglJ6kOnkEVdmyu4algVumO7xanA0Q=; b=gE4z8N0VVbWg2gjCU5KPfcz5JrqPadeKX5s9jg9Ll+8F6A9BIxf1Q5G1WkXaVbu+y3 jHSE/RpRbREt45a84PYY6qwaxuDIEO9upMKJR8FL/THKisFFOkx7R4WCv3Frqgf9x+qW 9v0TTClLilop/mRfnk5F4Lx3QEAv7r+nkczMvIN/lO17GcWYwtDH3qsiYXailCZr6WLU 4GzJSKT3ZG0VqIESqh3Ktx/XcooADIo0BRinl9iHMQ3BxsnK0I9Oba6PGPdYxWd10TWz 4a8ow9L4XCvx+wva5PZ8MAVDIU4I1sqdMsM1nsj2ZeCI45u/h0pRs6EUrFWLyC7uo3mJ XtSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EkhG6AFxavZ5abglJ6kOnkEVdmyu4algVumO7xanA0Q=; b=H6uamymkV71Cf4cgLVFYnUwdaGtkKyRNjDOZxtgS4XlYReIi2fJf4/MRhdysxkklS3 dIYxNUbq0o9MfHEeY0d0oCO0eG+3nwXysjulcJWflXx5fMAY2NQVG8Og7VW/+fWjRism qVgNDOcYlc7W7NmOeHHB9FgeIoJlotxMY7Av4OOozEoANCGooIADdqJWtjk0kMLQLEvn Q+n4XWyqkfwjIGjngCUOzG+XtlWePqCpa0ZuciSlG1Hg6mf04X25cU4eKas5YUrrqwWs hOs923fMG+k1piHiT1pTQM3JepNTmVef2izYjk9MhJn96+cue8qwyY2Le2w6uymBUfpv Oucg== X-Gm-Message-State: AOAM530GI7aMhyznULDfpmrhPkQCwzxIdaONC5hkVxJLel6BivMGO24w 4VIaJJonaNjfd08UCPEQINSAFOuw2J25r98Y X-Google-Smtp-Source: ABdhPJywfiPcIm5SlcRa1An3MqCAC8TlSl/2x1QRfTu9cA8iT509Y+0ZLcwB/SeI5BYl+Ke0OoCzJA== X-Received: by 2002:a17:902:b7c3:b029:da:76bc:2aa9 with SMTP id v3-20020a170902b7c3b02900da76bc2aa9mr1730765plz.21.1606672494598; Sun, 29 Nov 2020 09:54:54 -0800 (PST) Received: from hermes.local (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id l23sm13114850pgn.40.2020.11.29.09.54.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2020 09:54:53 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , petrm@mellanox.com Date: Sun, 29 Nov 2020 09:54:35 -0800 Message-Id: <20201129175437.15346-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201129175437.15346-1-stephen@networkplumber.org> References: <20201129175437.15346-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 3/5] tc: fix compiler warnings in ip6 pedit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Gcc-10 complains about referencing a zero size array. This occurs because the array of keys is actually in the following structure which is part of the overall selector. The original code was safe, but better to just use the key array directly. Fixes: 2d9a8dc439ee ("tc: p_ip6: Support pedit of IPv6 dsfield") Cc: petrm@mellanox.com Signed-off-by: Stephen Hemminger --- tc/p_ip6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tc/p_ip6.c b/tc/p_ip6.c index 71660c610c82..83a6ae8183a7 100644 --- a/tc/p_ip6.c +++ b/tc/p_ip6.c @@ -82,7 +82,7 @@ parse_ip6(int *argc_p, char ***argv_p, /* Shift the field by 4 bits on success. */ if (!res) { int nkeys = sel->sel.nkeys; - struct tc_pedit_key *key = &sel->sel.keys[nkeys - 1]; + struct tc_pedit_key *key = &sel->keys[nkeys - 1]; key->mask = htonl(ntohl(key->mask) << 4 | 0xf); key->val = htonl(ntohl(key->val) << 4); -- 2.29.2