From nobody Sat May 18 12:12:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1673268086; cv=none; d=zohomail.com; s=zohoarc; b=ByKPE8aQMyu/V6810b/kZWNeg/i2mbb9lpZWlUth0eeVntNdhjsIQv4GCTu6BDqMtpaWpqYgvmjCQtdFG9aIQwtJZE6+4647YRn2Bz7pUxzSI67x0KEGZfpO3qnOIZaujUKB0Lg8H0c5yWGgLqgFI3qGKvbp6b9UqEJkV5iuCEo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673268086; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=xaj0lvEle2LnNG7hVwbW0s6n70t+C9RINYExhEZZE1w=; b=OaTLaMw+g+DvJPl6Rg1syCv3aWy64kgEN7sO1JT8auExrry2lC976a5SiH5eG61o49vPfDIqvNDzXZamr4zIG5+0klllOT+s0vCyV4YEwphv0zy9lsz2Rm2PtEOWQAf2sqS/3JLyp0q5sbaO2KYb3dYUlfL6upChrz81mg8fc60= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1673268086329338.17284712150945; Mon, 9 Jan 2023 04:41:26 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-616-hKICHidYOcCFDV2ctE0ZwA-1; Mon, 09 Jan 2023 07:41:22 -0500 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 48FE81C068C7; Mon, 9 Jan 2023 12:41:20 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1A637492C14; Mon, 9 Jan 2023 12:41:20 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id EC3CF1947B9A; Mon, 9 Jan 2023 12:41:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CBCCF1947B94 for ; Mon, 9 Jan 2023 12:41:18 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id BFF06175AD; Mon, 9 Jan 2023 12:41:18 +0000 (UTC) Received: from speedmetal.redhat.com (ovpn-208-20.brq.redhat.com [10.40.208.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 32F4242220 for ; Mon, 9 Jan 2023 12:41:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673268085; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=xaj0lvEle2LnNG7hVwbW0s6n70t+C9RINYExhEZZE1w=; b=f/W2XDPtVqG33uGsgTsLkrEbdBI2eXE7RKGSNJ+eL3tTUb8SduVAT31ZDZz1tVK+cFy+SO nC+wAVCEBjR7Mq1rlgJfvg8mz5kwrjrlYEQVBlJeJk2/NiMGXPFgqVstCZt0+fIuz9MIAp 7fyV2fmyclK7eu6yvC2ZCn1rJKjtkCU= X-MC-Unique: hKICHidYOcCFDV2ctE0ZwA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH] virNWFilterSnoopLeaseFileLoad: Don't typecast 'ipl.timeout' Date: Mon, 9 Jan 2023 13:41:17 +0100 Message-Id: <03eb02932e3e0144fc83b4b25b71a9a7fbe17420.1673268046.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1673268088181100001 Use a temporary variable to avoid memory alignment issues on ARM: ../src/nwfilter/nwfilter_dhcpsnoop.c: In function =E2=80=98virNWFilterSnoop= LeaseFileLoad=E2=80=99: ../src/nwfilter/nwfilter_dhcpsnoop.c:1745:20: error: cast increases require= d alignment of target type [-Werror=3Dcast-align] 1745 | (unsigned long long *) &ipl.timeout, | Fixes: 0d278aa089bf3a00bf2d6e56d2f01ea4677190a7 Signed-off-by: Peter Krempa Reviewed-by: Martin Kletzander --- Corresponding job: https://gitlab.com/pipo.sk/libvirt/-/jobs/3565653957 src/nwfilter/nwfilter_dhcpsnoop.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcp= snoop.c index e604d67b96..20afc1b2d4 100644 --- a/src/nwfilter/nwfilter_dhcpsnoop.c +++ b/src/nwfilter/nwfilter_dhcpsnoop.c @@ -1733,6 +1733,8 @@ virNWFilterSnoopLeaseFileLoad(void) fp =3D fopen(LEASEFILE, "r"); time(&now); while (fp && fgets(line, sizeof(line), fp)) { + unsigned long long timeout; + if (line[strlen(line)-1] !=3D '\n') { virReportError(VIR_ERR_INTERNAL_ERROR, _("virNWFilterSnoopLeaseFileLoad lease file " @@ -1742,13 +1744,13 @@ virNWFilterSnoopLeaseFileLoad(void) ln++; /* key len 54 =3D "VMUUID"+'-'+"MAC" */ if (sscanf(line, "%llu %54s %15s %15s", - (unsigned long long *) &ipl.timeout, - ifkey, ipstr, srvstr) < 4) { + &timeout, ifkey, ipstr, srvstr) < 4) { virReportError(VIR_ERR_INTERNAL_ERROR, _("virNWFilterSnoopLeaseFileLoad lease file " "line %d corrupt"), ln); break; } + ipl.timeout =3D timeout; if (ipl.timeout && ipl.timeout < now) continue; req =3D virNWFilterSnoopReqGetByIFKey(ifkey); --=20 2.38.1