From nobody Fri May 19 09:46:04 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 4QN2645MfKz4BkTr; Fri, 19 May 2023 09:46:04 +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 4QN2644pGLz4Mw4; Fri, 19 May 2023 09:46:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684489564; 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=29bJsgFgY/1nN3Ib7clXx/P9wZ/hSJjT3utO7CNAcUg=; b=oXFAkVe07mBhSte2rMwveUlsGnqO2EylchZqvZ/sqMSm0kANhvQauP2liMdzRgRn6ZhkCX rnmjSEQHVxXeE3Xoekfz9uVCOTcr0jjn2NseQ+Ffhd/Q+USGn9tV4t5K0qFAzkOLqUK0WG WkI/xM4ZJnGNsUi7X3jhEpvrBbxW8bDsmX8V/EUTWEKrYnM8QGEoySU9WcJXqc3VzrPF35 yUtR+v4OjTy9jr1KqUmwmSqT1r3MJ7vcFk9hT3LQ18CHKbfYxSPW6QicRKigVqmEaXxfdm DCbakrNwQr8iELaN5PX792kLtm0AY53ikzw/TwCyYK2n8l+LmiyFdv4H4s7vBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684489564; 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=29bJsgFgY/1nN3Ib7clXx/P9wZ/hSJjT3utO7CNAcUg=; b=eHNPSTSUWU0j1RJGpzs2Afqxs/1vSV9Nm+Lsg3N5QQEctWYt2hiejiKjo1e1p/EdXSuETw MnQjortRtYhKKc3g1SXigg1fTGEk/gOhtttJz9TZOvTjeRmpW/Y1vJO+u7apA/B5SSskfn IbTfoHyO7JLnrWlQ8qSqK/D9TIM45N4kOgnSl7R96/E1OgmKjbJDmoQVxNJ6XKKqS0HzrR 24EmoJj7Z6/4DWdkMXpHg8XN2EfEWcd2dDdFl6HxpOyvShXVi/obYlNImek2xL4kutjot/ tEdXJmNztN/JCHsi+qA/gmMceOsWiU1xxT50F5cyeZq3/buWlG86D5UwqRM1ig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684489564; a=rsa-sha256; cv=none; b=woEigXy0wdfD1Sahjd2Kk1quu3MxlNqDYolG2i+603KK1t1Z8Suazb99MJGJcff3j4OyRA edvDSNKbp3cXvdlW7Yzd+VzNQsG5qXoylaWBOtqA2ucwWiCh+7M2kEgJjxmgy6O0J97URL ECoUQy8Kn++G/nWm/aNkmNUSe9de00HDgCZGbfkOnkoX4a/ICzeSYTv/Fxh5f5K576O9DT KdNLbR/R3zsRArQam1chzedZspiKv/STyjToQkArP/7KugZyUXc0jPNztQtzlxINhretW+ 25LAvK6zPgq2kxn+cyGKeCyvFWxuUj2EPPqsQ4tB82XK9o5xjpEfLNDJ1Ngcew== 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 4QN2643s9PzNnj; Fri, 19 May 2023 09:46:04 +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 34J9k4VY065091; Fri, 19 May 2023 09:46:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34J9k4C6065090; Fri, 19 May 2023 09:46:04 GMT (envelope-from git) Date: Fri, 19 May 2023 09:46:04 GMT Message-Id: <202305190946.34J9k4C6065090@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: 1377eb268a5a - main - netlink: add IPv4/IPv6 attribute writers using in[6]_addr instead of sockaddrs. 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: 1377eb268a5a8a5573bda33a651963259c43c3ed Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=1377eb268a5a8a5573bda33a651963259c43c3ed commit 1377eb268a5a8a5573bda33a651963259c43c3ed Author: Alexander V. Chernikov AuthorDate: 2023-05-19 09:44:21 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-05-19 09:45:49 +0000 netlink: add IPv4/IPv6 attribute writers using in[6]_addr instead of sockaddrs. MFC after: 2 weeks --- sys/netlink/netlink_snl_route.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/netlink/netlink_snl_route.h b/sys/netlink/netlink_snl_route.h index 95be0b588f69..619e769b1496 100644 --- a/sys/netlink/netlink_snl_route.h +++ b/sys/netlink/netlink_snl_route.h @@ -127,6 +127,18 @@ snl_attr_get_ipvia(struct snl_state *ss, struct nlattr *nla, return (false); } +static inline bool +snl_add_msg_attr_ip4(struct snl_writer *nw, int attrtype, const struct in_addr *addr) +{ + return (snl_add_msg_attr(nw, attrtype, 4, addr)); +} + +static inline bool +snl_add_msg_attr_ip6(struct snl_writer *nw, int attrtype, const struct in6_addr *addr) +{ + return (snl_add_msg_attr(nw, attrtype, 16, addr)); +} + static inline bool snl_add_msg_attr_ip(struct snl_writer *nw, int attrtype, const struct sockaddr *sa) {