From nobody Mon Mar 27 11:54:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PlWSV4jN4z42B00; Mon, 27 Mar 2023 11:54:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PlWSV47H0z3Pg3; Mon, 27 Mar 2023 11:54:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679918058; 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; bh=jKY0KpoW4kdvJoZwZ5KhPemblgJdd+mnQ4JutM3yOtE=; b=JJlthR6CPT/cGtgknuaenIGGxe//oqnPicel3pHB+MJBCir/WfQpwYBGxFx4+nwIoBVTZb dU1FhkEJLHAUYMCBIhz98PdtHyZ8GseCSgWNzNoMiMUVYY/phqAV2sC00zHpzY6xbcQ2jW 1k/ucSryIWQ+sPGV9QGIUeYmWITqzliWz56Op3/FeLoohOmtPKdrwVmXAIPYUARVgWR6Cs OJ1jeY9ac6IliN4Qc8INyiyVDeTVFJhMt/WkK0Pot9SHf8/VoYvo9bpUDyaa4Xjk7eKISR fw18dG4LZjP2pZvk3iWgPDKaXv9DLovB0ecThG00Gkg+rZSdENIv6dtpZFA8OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679918058; 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; bh=jKY0KpoW4kdvJoZwZ5KhPemblgJdd+mnQ4JutM3yOtE=; b=MFf3h8b45+8cdenJRdHL2DRzOMewQXZcoRadf2er8uOXM0EKtIbSCIZZ9l9LiYf1mmM8dJ n4NJnUWiJuMAfkEBMe1wYz0qF7IUtSnRZVM2mU5Tt5bIp7iU+FqvDy7eanX3MF1/sxs0P5 djvpsYpngKrGwtJjv2CBY72cJybUM8NGlBExT9oEz19rfIvpbKyb3evZtGrr+Pv9GK7+eX zfPHmuCvLP1WRv6SH4X1AG8EnF7y29zell1rPU8xm53fVSBxmunWarTPTtS/IPaRrb/TOk OYXTXs7Buk/EfbIYME2P6yme7d4gqCXWhWJXRdgdNytE4VcT6Ro7zhDA4FWaSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679918058; a=rsa-sha256; cv=none; b=FYKP/qz+FMhtYMBh1A9PyC4UeigU5q+TWtqXqOCeKWrQFhWWNCWVRTse9LQ77yR7JYEoYS b1Nf2V7y4XtMRIKMrNzPFmsgOzk6pxZZNjzQXNlHeKNNxhOYY8T+rEHzYKABrrFqilafjc 2p6xBzVqb36dJR1PYcz0buIRdmzgQK9qWEkvFqRPQW45BxhQ2ZxmJpeeoTLyPpSmYxUBWU NDMcRASPZ64EPaSoIgON0ON/JHZoiiw4lhh0DoBYnolbSE9KQS9ZIDiz0KV0drmke2cK/x JY3uQZRKvfDblS7WQOMHdiEQfCyiHFD1/CSOgNI5ORbFfwExl/0qYxjicRH8Wg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PlWSV38pczLc6; Mon, 27 Mar 2023 11:54:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32RBsIls008076; Mon, 27 Mar 2023 11:54:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32RBsIYb008075; Mon, 27 Mar 2023 11:54:18 GMT (envelope-from git) Date: Mon, 27 Mar 2023 11:54:18 GMT Message-Id: <202303271154.32RBsIYb008075@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: eccccd657f01 - main - netlink: make nlattr_add_in[6]_addr inline List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eccccd657f018c35397e49b29cce527103bfd381 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=eccccd657f018c35397e49b29cce527103bfd381 commit eccccd657f018c35397e49b29cce527103bfd381 Author: Alexander V. Chernikov AuthorDate: 2023-03-27 11:53:34 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-03-27 11:53:34 +0000 netlink: make nlattr_add_in[6]_addr inline MFC after: 2 weeks --- sys/netlink/netlink_message_writer.c | 14 -------------- sys/netlink/netlink_message_writer.h | 18 ++++++++++++------ 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/sys/netlink/netlink_message_writer.c b/sys/netlink/netlink_message_writer.c index 85cf5695643c..8a9315eedd1b 100644 --- a/sys/netlink/netlink_message_writer.c +++ b/sys/netlink/netlink_message_writer.c @@ -37,8 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include #include @@ -688,15 +686,3 @@ nlmsg_end_dump(struct nl_writer *nw, int error, struct nlmsghdr *hdr) return (true); } - -bool -nlattr_add_in_addr(struct nl_writer *nw, int attrtype, const struct in_addr *in) -{ - return (nlattr_add(nw, attrtype, sizeof(*in), in)); -} - -bool -nlattr_add_in6_addr(struct nl_writer *nw, int attrtype, const struct in6_addr *in6) -{ - return (nlattr_add(nw, attrtype, sizeof(*in6), in6)); -} diff --git a/sys/netlink/netlink_message_writer.h b/sys/netlink/netlink_message_writer.h index 2f007e9a2b14..b86a755339c8 100644 --- a/sys/netlink/netlink_message_writer.h +++ b/sys/netlink/netlink_message_writer.h @@ -31,6 +31,8 @@ #ifdef _KERNEL +#include + /* * It is not meant to be included directly */ @@ -249,12 +251,6 @@ nlattr_add_s64(struct nl_writer *nw, int attrtype, int64_t value) return (nlattr_add(nw, attrtype, sizeof(int64_t), &value)); } -struct in_addr; -bool nlattr_add_in_addr(struct nl_writer *nw, int attrtype, const struct in_addr *in); - -struct in6_addr; -bool nlattr_add_in6_addr(struct nl_writer *nw, int attrtype, const struct in6_addr *in6); - static inline bool nlattr_add_flag(struct nl_writer *nw, int attrtype) { @@ -267,6 +263,16 @@ nlattr_add_string(struct nl_writer *nw, int attrtype, const char *str) return (nlattr_add(nw, attrtype, strlen(str) + 1, str)); } +static inline bool +nlattr_add_in_addr(struct nl_writer *nw, int attrtype, const struct in_addr *in) +{ + return (nlattr_add(nw, attrtype, sizeof(*in), in)); +} +static inline bool +nlattr_add_in6_addr(struct nl_writer *nw, int attrtype, const struct in6_addr *in6) +{ + return (nlattr_add(nw, attrtype, sizeof(*in6), in6)); +} #endif #endif