From patchwork Thu Oct 9 09:21:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 2147526 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4cj4DL4qKkz1y1V for ; Thu, 9 Oct 2025 20:23:14 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 447F083C0A; Thu, 9 Oct 2025 09:23:13 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id i6aYPpdzvF58; Thu, 9 Oct 2025 09:23:10 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.9.56; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org A18E083BE0 Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id A18E083BE0; Thu, 9 Oct 2025 09:23:10 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 702E3C060E; Thu, 9 Oct 2025 09:23:10 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 15F63C060E for ; Thu, 9 Oct 2025 09:23:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id D1CFE40FE0 for ; Thu, 9 Oct 2025 09:23:00 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 875QwC0yDwwS for ; Thu, 9 Oct 2025 09:22:59 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.128.66; helo=mail-wm1-f66.google.com; envelope-from=i.maximets.ovn@gmail.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 73CC940FCD Authentication-Results: smtp2.osuosl.org; dmarc=none (p=none dis=none) header.from=ovn.org DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 73CC940FCD Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by smtp2.osuosl.org (Postfix) with ESMTPS id 73CC940FCD for ; Thu, 9 Oct 2025 09:22:59 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id 5b1f17b1804b1-46e48d6b95fso6506755e9.3 for ; Thu, 09 Oct 2025 02:22:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760001777; x=1760606577; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7DMjpEAp5BfDQ3o6NfPAPW9eepzmsHyWqC8boWZ8GdI=; b=SbHtF3QzDuVgg5y4GzJ6TYItjt508+qwAERxOx1ElUo5kdDuWLFyqBCA3kxyqf9lot rXPOa4LxgjeJjpTSZmT4hsaVzKnK/U4m8ICBkjCKZDXO/FZt6QBLbna3nNnPVPQeTn1g L7LHML38JbMUR6SfG31QI1BOKY4Ms6aU1xH2dA+X3OBb7L9D2WpI/vOUWmxR0/1L/KTG k8LXrRLKiL9lZkq8lzfJIL5TXeiPHRApP6Lc9EGGmUfe6jK5qtwHPYB+TelcKz6FAuZV xbWRHK2FiNscEkY23RZ3M5OOF4C9VFYw3m3UMzWcWmV1f8ZR/plI50ZrdWE+/Dp6Nqwn ZtcA== X-Gm-Message-State: AOJu0Yx0Qkm439OsMjNh1+ZQdhluoyVtQIm2Tn04Bz9Kj7vFgmfDNtCu E6q11yRKSS1g/Qx/jmdFjcojY4nPu9XRI4/Te4tnnS1e5QAgZuAomCSQUlN9mT22 X-Gm-Gg: ASbGnct2vxB26zf1rR8tXDBBqXe78dgMZ1BYDKrxxuM2rhDkeA0lCQtF8fOmI10j1Q5 6Go3iKzCV0Q35hifSiJP6CJLwOIVDMqgeGM5pYR51evKWpCE2RBqxtqQSR+86X/mPOnGMC8qd3G b43Z4I1rleRQI0Zm5UcjtGumzRHkBmaU1K5qzZyl+tLrYmvnzndqsFeSrUWUTZ3c4FuRZxBG3eB s/j/JbQxRIzghKCZRzJiVhO48pjp/lJtHon6kEZiDt2nJ2ghbN2lxu1CpKxIbsDM560ncBrLopa VoKMuW/ITaXwF3dMUrAI7C1iCLqfMBvkQ15IPtXRbgbDGMye/czPIXkRXjUxsRJFHExbJxCYSL4 5y6/WiB++lc1fVIa09ZXnRbK2BNmGloqkb4nITGnAqlRhUJ/g1pzFhfjet72miSwYyrIM5SCVWI ahDpha8gwwjkA= X-Google-Smtp-Source: AGHT+IGdbeM6GqDJ60ktJsUWfL/UfgwBljeok0Sksb6IiYm2mCysT0MGsLDQ/OWjPhPebMrAQIQzKA== X-Received: by 2002:a05:600c:64c4:b0:45d:d68c:2a36 with SMTP id 5b1f17b1804b1-46fa9b079camr45746745e9.27.1760001777287; Thu, 09 Oct 2025 02:22:57 -0700 (PDT) Received: from im-t490s.redhat.com (37-48-48-237.nat.epc.tmcz.cz. [37.48.48.237]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4255d8f0392sm34313629f8f.42.2025.10.09.02.22.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Oct 2025 02:22:56 -0700 (PDT) From: Ilya Maximets To: ovs-dev@openvswitch.org Cc: Ilya Maximets Date: Thu, 9 Oct 2025 11:21:24 +0200 Message-ID: <20251009092228.382349-5-i.maximets@ovn.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251009092228.382349-1-i.maximets@ovn.org> References: <20251009092228.382349-1-i.maximets@ovn.org> MIME-Version: 1.0 Subject: [ovs-dev] [PATCH 4/6] test-netlink-policy: Fix missing field initializer warnings on older GCC. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" For some reason GCC 4.8 doesn't like this style of initialization, complaining that nla_type is missing in the initializer: tests/test-netlink-policy.c: In function 'test_nl_policy_parse_ll_addr': tests/test-netlink-policy.c:60:9: error: missing initializer for field 'nla_type' of 'struct nlattr' [-Werror=missing-field-initializers] .nlattr.nla_type = TEST_POLICY_ATTR, ^ Let's use a normal designated initializer for the nested structure to avoid this issue. Fixes: 2f2ae5b6bdef ("tests: Fix endianness in netlink policy test fixtures.") Signed-off-by: Ilya Maximets Acked-by: Kevin Traynor Acked-by: Eelco Chaudron --- tests/test-netlink-policy.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/tests/test-netlink-policy.c b/tests/test-netlink-policy.c index 55083935a..fee65fc30 100644 --- a/tests/test-netlink-policy.c +++ b/tests/test-netlink-policy.c @@ -48,35 +48,30 @@ test_nl_policy_parse_ll_addr(struct ovs_cmdl_context *ctx OVS_UNUSED) { struct nlattr *attrs[ARRAY_SIZE(policy)]; struct nlattr_fixture fixture_nl_data_policy_short = { /* too short according to policy */ - .nlattr.nla_len = 5, - .nlattr.nla_type = TEST_POLICY_ATTR, + .nlattr = { .nla_len = 5, .nla_type = TEST_POLICY_ATTR }, .data = { 0x00 }, }; struct nlattr_fixture fixture_nl_data_policy_long = { /* too long according to policy */ - .nlattr.nla_len = 25, - .nlattr.nla_type = TEST_POLICY_ATTR, + .nlattr = { .nla_len = 25, .nla_type = TEST_POLICY_ATTR }, .data = { 0x00, 0x00, 0x67, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x1d, 0x2d, 0x03, 0x00, 0xa5, 0xf0, 0x2f, 0x00, 0x00 }, }; struct nlattr_fixture fixture_nl_data_eth = { /* valid policy and eth_addr length */ - .nlattr.nla_len = 10, - .nlattr.nla_type = TEST_POLICY_ATTR, + .nlattr = { .nla_len = 10, .nla_type = TEST_POLICY_ATTR }, .data = { 0x00, 0x53, 0x00, 0x00, 0x00, 0x2a }, }; struct nlattr_fixture fixture_nl_data_ib = { /* valid policy and ib_addr length */ - .nlattr.nla_len = 24, - .nlattr.nla_type = TEST_POLICY_ATTR, + .nlattr = { .nla_len = 24, .nla_type = TEST_POLICY_ATTR }, .data = { 0x00, 0x00, 0x00, 0x67, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x1d, 0x2d, 0x03, 0x00, 0xa5, 0xf0, 0x2f }, }; struct nlattr_fixture fixture_nl_data_invalid = { /* valid policy but data neither eth_addr nor ib_addr */ - .nlattr.nla_len = 11, - .nlattr.nla_type = TEST_POLICY_ATTR, + .nlattr = { .nla_len = 11, .nla_type = TEST_POLICY_ATTR }, .data = { 0x00, 0x53, 0x00, 0x00, 0x00, 0x2a, 0x00 }, }; struct ofpbuf *buf;