From nobody Sat Apr 08 19:44:51 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 4Pv5Kv5cyHz44nmR; Sat, 8 Apr 2023 19:44:51 +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 4Pv5Kv2RZpz43yD; Sat, 8 Apr 2023 19:44:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1680983091; 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=hqur3bneWuTxwKg99P2qwAeBcB2Mg/FeJkCCoB/Lp7M=; b=RXwAIy0yD+kLQ448N3/XR0QtuVeM8zpOWUmFpife0rI7gsVboI77FayImFIyom19Q/Jsig M54t1gysbSkjV4qmDsj3LDidI7V7QTDu9ctCBHaEhBWglqvcD9MjBUVmdTeJAxQkxxa8WJ uOBko2di1Wsaj+ntBPWQ3gB3x5HMrKIGmigESD5bWLXh703+/IZq5xe5f5ZKvZtXQZTbe3 7QjD9h2v+aexMP8AfOqjkUR8OVbAN/qGVM9uTZGVuQU2sYYX4nY1gFtT66O/qn/wFPnBo2 ZKbu9/8dGbqLh9noGPRyXFY7UffG7yvFmW43/Hgr4DzoXLrZAZJwTijzRW9pjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1680983091; 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=hqur3bneWuTxwKg99P2qwAeBcB2Mg/FeJkCCoB/Lp7M=; b=KeCAU1P4HyQWs+bXVB/0k0vdLVA7Qdk46bLdvaVgPIaLghRxHVGH1G8bUHr2kiQvOXvc/4 V4z2rOJSerdGIFYMwp5E0Kjj8zzqPYndvoQq2+1PHkBvuE1ohma+SDFoN71QYoT2n+lRDp lQ7sUoNzBxyNz0btOltJdjt3oVjVYeAil81WppEodNevWYibdgHJ9HPo1f2YkGpN162QNm 5/M84icppYs9fJHsswMyDZT0AiyUG0mezfwiolAM9E7F2LGijniP5fnH9Cip8mPmSlak7B xRWGWBi2vsfToSRrz4j5OUKCqjDGkft1obGcojzPn2mTSwUlxxu7Z31GhZ/IXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1680983091; a=rsa-sha256; cv=none; b=IQ6rIWChqbQ2FwiVhXovqyCbG2cuJQV1nJjFo7HKUml41rXPTvMvLnkrdimplqkJiBSva2 26gMNvtjRHAMmpRp0d2fGk3xZvK7fAbYDVhjXKbtyRklmSxrfGirT0OJ2yDIbLUT74AiYo ES1MAO/0zfLx8OVV8kCTFk6c+ssvJPdpiQRxkFIrGsF92NEN0vaymM1NA+e3lsogxIZIRN WqezDdz6OeY1bEH/eumHgswpqd1CWICRyXLE25PjtEuMB5oj8FqB2TG7t1quuaeSNqYNWC lLTOU0z6FeAsjcFtqjorKODUKuBX8UY2A4YF89YYoBtTGcaEnbJWi8KstFs0xg== 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 4Pv5Kv1F2CzfSx; Sat, 8 Apr 2023 19:44:51 +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 338JipO8018712; Sat, 8 Apr 2023 19:44:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 338JipsR018711; Sat, 8 Apr 2023 19:44:51 GMT (envelope-from git) Date: Sat, 8 Apr 2023 19:44:51 GMT Message-Id: <202304081944.338JipsR018711@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 96a0db365f5d - stable/13 - netlink: add rtsock-compatible header to use with netlink snl(3). 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 96a0db365f5d315fd97b480bb3ecc84cba296d8d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=96a0db365f5d315fd97b480bb3ecc84cba296d8d commit 96a0db365f5d315fd97b480bb3ecc84cba296d8d Author: Alexander V. Chernikov AuthorDate: 2023-03-09 14:36:52 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-04-08 19:05:50 +0000 netlink: add rtsock-compatible header to use with netlink snl(3). Some routing socket defines (`RTM_` and `RTA_` ones) clash with the ones used by the the Netlink. As some rtsock definitions like interface flags or route flags are used in both netlink and rtsock, provide a convenient way to include those without running into the define collision. Differential Revision: https://reviews.freebsd.org/D38982 MFC after: 2 weeks (cherry picked from commit 90d625122886a2db5b66d248807b89f4a0270466) --- sys/net/route.h | 7 +++++ sys/netlink/netlink_snl_route_compat.h | 50 ++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/sys/net/route.h b/sys/net/route.h index 3dac437426b0..870ebbc0bc75 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -268,6 +268,7 @@ struct rt_msghdr { #define RTM_VERSION 5 /* Up the ante and ignore older versions */ +#ifndef NETLINK_COMPAT /* * Message types. * @@ -300,6 +301,8 @@ struct rt_msghdr { #define RTM_IFANNOUNCE 0x11 /* (5) iface arrival/departure */ #define RTM_IEEE80211 0x12 /* (5) IEEE80211 wireless event */ +#endif /* NETLINK_COMPAT*/ + /* * Bitmask values for rtm_inits and rmx_locks. */ @@ -313,6 +316,8 @@ struct rt_msghdr { #define RTV_RTTVAR 0x80 /* init or lock _rttvar */ #define RTV_WEIGHT 0x100 /* init or lock _weight */ +#ifndef NETLINK_COMPAT + /* * Bitmask values for rtm_addrs. */ @@ -325,6 +330,8 @@ struct rt_msghdr { #define RTA_AUTHOR 0x40 /* sockaddr for author of redirect */ #define RTA_BRD 0x80 /* for NEWADDR, broadcast or p-p dest addr */ +#endif /* NETLINK_COMPAT*/ + /* * Index offsets for sockaddr array for alternate internal encoding. */ diff --git a/sys/netlink/netlink_snl_route_compat.h b/sys/netlink/netlink_snl_route_compat.h new file mode 100644 index 000000000000..51904abb4003 --- /dev/null +++ b/sys/netlink/netlink_snl_route_compat.h @@ -0,0 +1,50 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2023 Alexander V. Chernikov + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _NETLINK_NETLINK_SNL_ROUTE_COMPAT_H_ +#define _NETLINK_NETLINK_SNL_ROUTE_COMPAT_H_ + +/* + * This file contains netlink-compatible definitions from the + * net/route.h header. + */ +#define NETLINK_COMPAT + +#include + +#define RTSOCK_RTM_ADD 0x1 +#define RTSOCK_RTM_DELETE 0x2 +#define RTSOCK_RTM_CHANGE 0x3 +#define RTSOCK_RTM_GET 0x4 +#define RTSOCK_RTM_NEWADDR 0xc +#define RTSOCK_RTM_DELADDR 0xd +#define RTSOCK_RTM_IFINFO 0xe +#define RTSOCK_RTM_NEWMADDR 0xf +#define RTSOCK_RTM_DELMADDR 0x10 +#define RTSOCK_RTM_IFANNOUNCE 0x11 +#define RTSOCK_RTM_IEEE80211 0x12 + +#endif