From nobody Sat Nov 23 18:23:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1723812354676497.97093286921915; Fri, 16 Aug 2024 05:45:54 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 9C1FE1384; Fri, 16 Aug 2024 08:45:53 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 1DE0B1377; Fri, 16 Aug 2024 08:45:16 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 82092136C; Fri, 16 Aug 2024 08:45:12 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 12718126F for ; Fri, 16 Aug 2024 08:45:12 -0400 (EDT) Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-627-SYJoFg1_MPWVjry3qU499A-1; Fri, 16 Aug 2024 08:45:10 -0400 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-3718d9d9267so741570f8f.0 for ; Fri, 16 Aug 2024 05:45:09 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3718985a7d3sm3588828f8f.61.2024.08.16.05.45.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Aug 2024 05:45:08 -0700 (PDT) Received: from wheatley.pinto-pinecone.ts.net (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 53DC21C16EA4 for ; Fri, 16 Aug 2024 14:45:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1723812311; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=pLDl88P5c0hLXdcIG3xInGLDg4dxwj2L0v21w3WLlSA=; b=AKEjYM2U1LsXsV91ShFjDLvysuf73sJfozxCZ1cSe9pYrd9WSp8g+0shPjnmCoA77eFQUo c3e4m9zOR1qgjVqvPG+iM1ig8gBKUSIAswPmIYMnWzfOq9HQvbi6TZjzvSDex+GVOVfzgW OowGs6t/LJsVLFTTfWZT3n+Hp8s30ks= X-MC-Unique: SYJoFg1_MPWVjry3qU499A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723812309; x=1724417109; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pLDl88P5c0hLXdcIG3xInGLDg4dxwj2L0v21w3WLlSA=; b=IZLRDQHh4d4C89XsCwBqslc8rIOuTkM9kwC6nbVdzByWBbbhfgZ6n1Zg/6IZ90b9e1 /AGKcqjwINvuMfdhhdalVIcS+l4vHImvDvOPlX39SRoJMkgPMhBmzqSxSPMtu0P5HLc2 odemaQMQPK9/Zu+4XLYpTjgapm2Oizcnufb1mAVU3rmsJpczm9ko2oC1yAb9jjswmOpS qdJrydw6bFtuwFcW8+XLyYQY2651KvpUs8oGHUg3GiclEjL6PhQZ1LHBA+JKrDEBcu2I qx/C252X8wMvCH2m7eyVukdgzCmnyfTjnBNIyyZy1299VkC4SSlViJMrKldQkMBb+LEm 8KiA== X-Gm-Message-State: AOJu0Yy9bURuYKUakA1URIOE3Tl96xUfkFqmgDLFvWGMILIb4z+R0jUS dim2asKkyBGy0IizVE/LJRX8xHU1lSXKtB42OHWFqY72Z6QAlE/CYyvmad7kltZfJB99Ixacbmt pxcChMXhaSv9N+1LjShRo6PMQvlBl8I3CroPr9brR/obRp+ec18k5jVcASjGX7JT3ZCNBM9Rlvo G3n03tLtkXe5peVSRPO9NM1FXhfJUY78Yeei85oVo= X-Received: by 2002:a5d:6742:0:b0:371:86b2:a7e4 with SMTP id ffacd0b85a97d-37194659619mr1841229f8f.37.1723812308833; Fri, 16 Aug 2024 05:45:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGO+6bEKMuA53QEggKYDYTY5iZCr/BwUcoLrqIXLaD0VYCiGrLXjB+hbm2JDcMs7+guSjJGSg== X-Received: by 2002:a5d:6742:0:b0:371:86b2:a7e4 with SMTP id ffacd0b85a97d-37194659619mr1841203f8f.37.1723812308332; Fri, 16 Aug 2024 05:45:08 -0700 (PDT) From: Martin Kletzander To: devel@lists.libvirt.org Subject: [PATCH 1/3] virarptable: Properly calculate rtattr length Date: Fri, 16 Aug 2024 14:45:02 +0200 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: ULHFIWQ6QW4CIP2FHSVHCMQ4SXXAYINE X-Message-ID-Hash: ULHFIWQ6QW4CIP2FHSVHCMQ4SXXAYINE X-MailFrom: mkletzan@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1723812356690116600 Content-Type: text/plain; charset="utf-8"; x-default="true" Use convenience macro from libnl3 which does almost the same thing we were doing, but also aligns the payload length. Signed-off-by: Martin Kletzander Reviewed-by: Laine Stump --- src/util/virarptable.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/virarptable.c b/src/util/virarptable.c index 299dddd664ab..d8e41c5a8668 100644 --- a/src/util/virarptable.c +++ b/src/util/virarptable.c @@ -102,8 +102,7 @@ virArpTableGet(void) return table; =20 VIR_WARNINGS_NO_CAST_ALIGN - parse_rtattr(tb, NDA_MAX, NDA_RTA(r), - nh->nlmsg_len - NLMSG_LENGTH(sizeof(*r))); + parse_rtattr(tb, NDA_MAX, NDA_RTA(r), NLMSG_PAYLOAD(nh, sizeof(*r)= )); VIR_WARNINGS_RESET =20 if (tb[NDA_DST] =3D=3D NULL || tb[NDA_LLADDR] =3D=3D NULL) --=20 2.46.0