From patchwork Sat Sep 28 09:03:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3534 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 06F3E3F38F for ; Sat, 28 Sep 2024 11:24:10 +0200 (CEST) Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-5c88bde66bdsf179464a12.2 for ; Sat, 28 Sep 2024 02:24:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1727515449; cv=pass; d=google.com; s=arc-20240605; b=UfmcVD33nh+JjRMoiamUg2Ml5db1ZDk5daNJc585b9125pZVilzn722esk026+0+B8 pCyUCbNwOSDeISjO1s/Uj2sBiac8ic0awbHoco3jbkubGaUjbGSkdSvISpBfMS9g9jIQ 6BRaBVB0PnhRhwJ0cM6bNXGi6HF+t8D0FnygObG0RxDHcm+KM/M25k6JKrrKJLr48O6h C5H0VaGXZKztEdc5i77ij1y5BkZUHkK6GPp4yOGsrPsPNZaOIxCxIlMN6jPpL9E4kSG6 8141fixt6FUCZwph/FGUAOdyJqd9dNCTxcDjsKmk+wiUwNrdGWxCe0whkt15nNC0ZXHl eL7Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=k2oEEpkwvnJYWZWXSQ2BAmrnfktllrgXzZsWShskdh0=; fh=0iI3aD5vS7ifiufQIofNZa3265pLbhy7SJPnxmZSWv8=; b=CpH91rioCrzVcoaN9tonbPzoX0hL0RH4HLGUT52HX7gnW4tJlVHmqYVUNfSLqYQe5K X1GbOpo/QkfZjrhkdlTavitCvMDx3XB22YYaR+aCGuFW9Dsv5uMKKyVmlE+IImX33ndx 0uF3C8EU+FEmAxvK/exqPhDqpYJ6TIW54Nq4GIt5BILcPw2WZrFotUnK7jXIKaNke3dp rN1P1MEK17wA+7RDI9+25in7ol+xlhAlfTaVBdJDRxgj8ntZyT/Tk7432QUp+ASQTvcb +la7rJj5AoXxPueeftaY0YMcdji2LB/RCpgp4moKj/JxRQ/l2m1Qv9VtSFSGLgFbBD3U 8DIg==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MvBaCLxA; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1727515449; x=1728120249; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :from:to:cc:subject:date:message-id:reply-to; bh=k2oEEpkwvnJYWZWXSQ2BAmrnfktllrgXzZsWShskdh0=; b=fJFr+cAmTIpkmMiDxh4ujewdDkOtyFhs/DIWbGX0iwCOzSE3Eswkxqh03IKJlX0HUL 4iYzua+RGOSSKO0sW5JiqSR9Q7tLo+CgNMQb7S9kIv0MfV5re5ueX4Z5q+6pfqmu9hC4 Un1tVs/ekZwLswpLjPQR4UZnTq9wi4ce9JU5c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727515449; x=1728120249; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-beenthere:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=k2oEEpkwvnJYWZWXSQ2BAmrnfktllrgXzZsWShskdh0=; b=Tg0SBqSPNQsQPRf2dFSmLf27xTm7VxEbMu+3qWuE4Q2l5TxiO6IrD5/lt4skklbU2L WQJZAAyg/eLZE7Jb5qTwBivC6Zn34olB8u+F+AWr80UbSXPsD4+tive6mVepYmFWqz9I zCgLzfDB+zURC3awBRVKiIq4bwFHImix2rZU8ecQP3BiDEtUF16aSDThz1UBJgZNoTeB k78xx40HPFJiTWI2j74MOSJ8ZvWcdcBZ/YQby5+8Y6Ge4EcM/N8MoCUsmUSaTniSu3XS +CE+ftz/5paSF7MPZn/Sg3ABzdrRBtMtMPZMGYstapJZXdepGkZLiFbhIvkuHgD21aKt CwMw== X-Forwarded-Encrypted: i=2; AJvYcCUZ6D/dqAJlr2v8pmPEAsuR2ziAZdJpF69vtpwXAvJCu5vNliaXLJM+CFTnjQIt7u9DcI6gymB4+rlcoaNI@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YwWWCkZoRoLObXxXV43FJ25ffFQUV+0oigTPM5X2bFF8QtlC5rp WAayw4aSOpFzieW8UJbPTzonMBSEDD2p94uliDZqfrVgtSaQ744IxcrgAv/Zhx5qkQ== X-Google-Smtp-Source: AGHT+IHpuQOYcEyqmA6MwcPPTIVKVvwZitZE4UdR3FTTVuAXF0zKfHwDrjBJ7/LNDzHivdaKTA93bA== X-Received: by 2002:a05:6402:2682:b0:5c8:8329:9ca7 with SMTP id 4fb4d7f45d1cf-5c883299e45mr3600385a12.4.1727515449483; Sat, 28 Sep 2024 02:24:09 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:26c9:b0:5c5:bb82:b1cf with SMTP id 4fb4d7f45d1cf-5c8777f335cls8766a12.1.-pod-prod-07-eu; Sat, 28 Sep 2024 02:24:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW8Ocr+WjmxbJN/p0OK8Sea/7oej9b+7EwjkiURP0mdIP//8tTEBjc6UyiKXJQayf2nLarAweJZY2ZRiZVe@amarulasolutions.com X-Received: by 2002:a17:907:971a:b0:a86:a481:248c with SMTP id a640c23a62f3a-a93c49182f0mr531853066b.19.1727515447761; Sat, 28 Sep 2024 02:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727515447; cv=none; d=google.com; s=arc-20240605; b=k5y21CRHI4+Y90K4/loa5acx3BiFJb3IV/eaa7LzpCD5uP0saCOIBpcdV/YRO92KjC av8++ef8pnObIdUui74VrOp2507+aQ3uqGhWcZwrMJbFt3BQlIXQ9RxmwvnSdvOA4LNA r3CM2+q2tzxjS24H53RdkG9HI2DwCVs60R7BoYKDGROuxeShA7U/sdLOjXGbWsZVPVoZ 0lSftOD6zTnVHL1UOMpzFaOaOJODl6cH+I0ZIHQGzO+uaNSgbKTETeugMDvjZm2ZmKTJ 4vEgPdSDVcicAlxTUlvC7iGCIXY7pGu+UXWxZUrzgTJp3RIheYbU3Fy0uADTaGN14+p6 Ifsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=pN05rJxi9x5uAQd3SKaJJht/p4GtRgscSDxujywkLE0=; fh=9Ob01fDVZIgeCvZudYtEIzXclEO1BFeIy70etfPZwyc=; b=LP3sRF++wyHKaWL/yqbfFgleifNJfLvW7bD81zFWLtz1fFA//WMFWL5z/UdrOUeKYE 1K8W25Ys5Y1gJKt5uYrsBc4twsZkNxxHEg03zevgjQIlqFYfwsjD3l9PnH0J09TK4WWO thtLV2b8FvevjOg/5yx+ocR4+fex4su07rlW6DsSDgoN5uYlP29Fp3TscBkzPmT6uVYp 8hRQE5RzK1BeNVHkEfLcsvIRZ6p/8yjc4jsUYfbKCN7GiDk22+9UiEpOYn2lKT3cjSA8 7kj3RNA5s16Qkx/r176p/CqJxDKDtjU18AN10e6cr1VjAeEzw/6hHa+BMOIoDMCtRQNG iesg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MvBaCLxA; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id a640c23a62f3a-a93db834195sor32305366b.7.2024.09.28.02.24.07 for (Google Transport Security); Sat, 28 Sep 2024 02:24:07 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Forwarded-Encrypted: i=1; AJvYcCWK3N3b+lwXkR2U4I+zIVXfUaLgUeolB0iCq3armNWimfceLHgkrfra0qBjMyqizcodyXoFtR9jU4G8OP44@amarulasolutions.com X-Received: by 2002:a17:907:6ea1:b0:a86:8f8f:4761 with SMTP id a640c23a62f3a-a93c491ae88mr496682266b.25.1727515447207; Sat, 28 Sep 2024 02:24:07 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-79-54-102-102.retail.telecomitalia.it. [79.54.102.102]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c88248c672sm2104213a12.60.2024.09.28.02.24.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Sep 2024 02:24:06 -0700 (PDT) From: Dario Binacchi To: netdev@vger.kernel.org Cc: Stephen Hemminger , linux-amarula@amarulasolutions.com, Dario Binacchi Subject: [iproute2, PATCH v2 1/2] arpd: use designated initializers for msghdr structure Date: Sat, 28 Sep 2024 11:03:11 +0200 Message-ID: <20240928090312.1079952-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MvBaCLxA; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch fixes the following error: arpd.c:442:17: error: initialization of 'int' from 'void *' makes integer from pointer without a cast [-Wint-conversion] 442 | NULL, 0, raised by Buildroot autobuilder [1]. In the case in question, the analysis of socket.h [2] containing the msghdr structure shows that it has been modified with the addition of padding fields, which cause the compilation error. The use of designated initializers allows the issue to be fixed. struct msghdr { void *msg_name; socklen_t msg_namelen; struct iovec *msg_iov; #if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN int __pad1; #endif int msg_iovlen; #if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN int __pad1; #endif void *msg_control; #if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN int __pad2; #endif socklen_t msg_controllen; #if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN int __pad2; #endif int msg_flags; }; [1] http://autobuild.buildroot.org/results/e4cdfa38ae9578992f1c0ff5c4edae3cc0836e3c/ [2] iproute2/host/mips64-buildroot-linux-musl/sysroot/usr/include/sys/socket.h Signed-off-by: Dario Binacchi --- Changes v1 -> v2: - Put one field per line. - Drop (void *) cast for msg_control field. misc/arpd.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/misc/arpd.c b/misc/arpd.c index e77ef53928a2..91f0006a60aa 100644 --- a/misc/arpd.c +++ b/misc/arpd.c @@ -437,10 +437,13 @@ static void get_kern_msg(void) struct iovec iov; char buf[8192]; struct msghdr msg = { - (void *)&nladdr, sizeof(nladdr), - &iov, 1, - NULL, 0, - 0 + .msg_name = &nladdr, + .msg_namelen = sizeof(nladdr), + .msg_iov = &iov, + .msg_iovlen = 1, + .msg_control = NULL, + .msg_controllen = 0, + .msg_flags = 0 }; iov.iov_base = buf;