From patchwork Sun Dec 12 21:17:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 1567057 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=rzv7esr9; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=hauke-m.de header.i=@hauke-m.de header.a=rsa-sha256 header.s=MBO0001 header.b=JiOmZqYG; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JByHC05pTz9t4b for ; Mon, 13 Dec 2021 08:20:52 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AkBYkNd1cOU5gfqoabXFBScOfhY1tNU3HRKwqkRUrjg=; b=rzv7esr9vrYh8F oeHlb2naCd+KUrg5UQpdrscDCINjeQTTyE5DA90ng1WauCZQbSzS8moxbQNVeKRAZTyFdwLtuGms+ tC2mFNb5isJC9Q8smdd6sTc6hnHUujI5ljtObRFooo/ZVdBtwLwmmCPdd/Q6p9mUVvkIDl+uQUlRE 0nc2lf6rZe9EDuj/N4OjUErrz6T6R09Oa3gsH1EltCX4o4GekATdbqI+kP0N6iYT6j2BKrfe5s0Wz LaEdWh5J+FZMmRSXQ8T/TYM7BCTZzBJglRuKsw1N+H46KJpLUVbXBxQXFGjenZq+LeHs+jra8/jxr IeWcGjFxtFbDmMK57k9g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mwWEM-007IxF-GJ; Sun, 12 Dec 2021 21:18:02 +0000 Received: from mout-p-201.mailbox.org ([80.241.56.171]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mwWEI-007Ivg-Kr for openwrt-devel@lists.openwrt.org; Sun, 12 Dec 2021 21:18:00 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [80.241.60.233]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4JByCj2RzqzQkM3; Sun, 12 Dec 2021 22:17:53 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hauke-m.de; s=MBO0001; t=1639343871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uGf05z5VQHIVb8tMAJMgGJRfKDI0Ma7eYqoMHSioRjI=; b=JiOmZqYGrol0E1OFt7x5SIYl5d9sn6+LyxITa5t+vZ5diN62uIOep+nK8eR5dg7ay7Shlp 3PwTBiv8Vg/RutEh9lrPiHn2vkaqeAhIROKX7Q4jTn5gqKuqy7TVkxK1eWSpduvJXfjj4U 5Muv8YPIFY63l/jta4lXxQ0OOxVhUtG1N5hSFhg/4GRdsjoYjbE0XMupYnpKU0vYEu1Dws O29LSCwdU8Op0FX655LLpNJYv+uSrsUz+TZUkTnf8/6iGnNo0rMrteRVt7ycyvbFS65BNs MJz+oiLaivQ1AXG4aQG5Ad1FQXEtHTpplBX0ZxNviiC0tP+7PJZ5vUfMKzQI1Q== From: Hauke Mehrtens To: openwrt-devel@lists.openwrt.org Cc: Hauke Mehrtens Subject: [PATCH 2/3] libnl-tiny: Add NLA_PUT_S32() Date: Sun, 12 Dec 2021 22:17:34 +0100 Message-Id: <20211212211735.2457250-2-hauke@hauke-m.de> In-Reply-To: <20211212211735.2457250-1-hauke@hauke-m.de> References: <20211212211735.2457250-1-hauke@hauke-m.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211212_131758_927340_61F9408F X-CRM114-Status: GOOD ( 11.39 ) X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This function is used by iw 5.16. Signed-off-by: Hauke Mehrtens --- package/libs/libnl-tiny/Makefile | 2 +- .../patches/0001-attr.h-Add-NLA_PUT_S32.patch | 62 +++++++++++++++++++ 2 files changed, 63 insertions(+), 1 [...] Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.171 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This function is used by iw 5.16. Signed-off-by: Hauke Mehrtens --- package/libs/libnl-tiny/Makefile | 2 +- .../patches/0001-attr.h-Add-NLA_PUT_S32.patch | 62 +++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 package/libs/libnl-tiny/patches/0001-attr.h-Add-NLA_PUT_S32.patch diff --git a/package/libs/libnl-tiny/Makefile b/package/libs/libnl-tiny/Makefile index bdb496c48e60..7fe8b5c5f708 100644 --- a/package/libs/libnl-tiny/Makefile +++ b/package/libs/libnl-tiny/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnl-tiny -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/libnl-tiny.git diff --git a/package/libs/libnl-tiny/patches/0001-attr.h-Add-NLA_PUT_S32.patch b/package/libs/libnl-tiny/patches/0001-attr.h-Add-NLA_PUT_S32.patch new file mode 100644 index 000000000000..517d4b5c1565 --- /dev/null +++ b/package/libs/libnl-tiny/patches/0001-attr.h-Add-NLA_PUT_S32.patch @@ -0,0 +1,62 @@ +From f4e190cfed119fcf8db4870b0a86dd6ba95034a8 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Sun, 21 Nov 2021 00:08:55 +0100 +Subject: [PATCH] attr.h: Add NLA_PUT_S32 + +This function is used by iw now. + +Signed-off-by: Hauke Mehrtens +--- + include/netlink/attr.h | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +--- a/include/netlink/attr.h ++++ b/include/netlink/attr.h +@@ -299,6 +299,31 @@ static inline uint16_t nla_get_u16(struc + } + + /** ++ * Add 32 bit signed integer attribute to netlink message. ++ * @arg msg Netlink message. ++ * @arg attrtype Attribute type. ++ * @arg value Numeric value to store as payload. ++ * ++ * @see nla_put ++ * @return 0 on success or a negative error code. ++ */ ++static inline int nla_put_s32(struct nl_msg *msg, int attrtype, int32_t value) ++{ ++ return nla_put(msg, attrtype, sizeof(int32_t), &value); ++} ++ ++/** ++ * Return payload of 32 bit signed integer attribute. ++ * @arg nla 32 bit integer attribute. ++ * ++ * @return Payload as 32 bit integer. ++ */ ++static inline int32_t nla_get_s32(struct nlattr *nla) ++{ ++ return *(int32_t *) nla_data(nla); ++} ++ ++/** + * Add 32 bit integer attribute to netlink message. + * @arg msg Netlink message. + * @arg attrtype Attribute type. +@@ -632,6 +657,15 @@ static inline size_t nla_strlcpy(char *d + NLA_PUT_TYPE(msg, uint16_t, attrtype, value) + + /** ++ * Add 32 bit signed integer attribute to netlink message. ++ * @arg msg Netlink message. ++ * @arg attrtype Attribute type. ++ * @arg value Numeric value. ++ */ ++#define NLA_PUT_S32(msg, attrtype, value) \ ++ NLA_PUT_TYPE(msg, int32_t, attrtype, value) ++ ++/** + * Add 32 bit integer attribute to netlink message. + * @arg msg Netlink message. + * @arg attrtype Attribute type.