From nobody Fri Dec 06 09:33:13 2024 X-Original-To: dev-commits-src-main@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 4Y4QzZ0dvFz5fwy1; Fri, 06 Dec 2024 09:33:14 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y4QzZ059vz4l5Z; Fri, 6 Dec 2024 09:33:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733477594; 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=pqMa4ISYv9GlNBuhoCy3p3FDOAyYX3zbRjnfVgG3aMg=; b=NiVURyb0GFWawAesiwbJpzes+GTxjI2LhXYQp6nR1zQwInRu/trqszLUmCsQMdjyMEGjVj GsKu2qVacMhicQjJVSEAKTe4PfgX9fGmX7TbnBpovKiB6uh4y4Kjkz7A4BG9NhmJZTBf3Q hjgcdTM2MJ0v2hBVSJ7dGM/n5L7Mu4m4fdU9CmkUQBL5VpKVOuQi9bKBkZeyFTZTL+j/9R YvKy5lBT5bP8g+JyIW5Qb1NVeRVlHCbB8cW6XLujPjbQNjc3F7FRuH6QAF0tQ4Hq/AtEcS FUr581AW1yd3ZteSE9L6Y0uI1CvMPiXtpnNyadj8HgmkfOorAdkpoVFZIgCljw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733477594; 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=pqMa4ISYv9GlNBuhoCy3p3FDOAyYX3zbRjnfVgG3aMg=; b=VqrgNdLmbKBmw3/u8rPIBWYDO/7oPxubCgUFaMj+QrdZnyDwUmbItL18L5ad7qiL0xoQ8H u3etEjLmk4hKRNkhQxC5FavKm9iWQBvhsmRfM83AK6cKpk71/OTqo2eiOFsgJLcP1shb50 lRCYiIUpFaLwcmg9lliPRW4BdVXO25p5GPbyaqfm/0JaWLYfBlv/NpWMmPFb1/lGUlijv2 89Y3pNRQdMzYPy4EIDhleycGQKhld7hK3dsjEaCdSqZHFXES50V1wIPTZnMdaFpbDAk+H1 CmmiwJtqSkrLsJcI6wGUAt3PP3WnxSFXfjZqT74NfLuDXvcN2DpZq9YkZ/Y8Pw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733477594; a=rsa-sha256; cv=none; b=nbAfZ5BIHTRANZYGv2520E2EapWsIOba9S4N1watD1le9TNYCfvs7WDkLfwS3Bv8tKHhwk QUTVH3mkgPfxfJGSlHbvygl4d51rJR8hWoYvtA2FIAhTBz/EfNkQLUqLrEZz98raqT2w0j R1ramK2WXFmr7sUH9Pwg1FFYsn2fmzBWZahOcPfhRy3CDcbbBJMyqdQMJbsFZnsnACFQbw YReUqMOAkjRT8tlKdzQBfgBtm/AsxarEwp+tuLDizIEgCad9DksVh1QODIFj+PGH4U7Av7 zz6tdh0a1iSUf4AScW6bwV2LhrThypQPRAp5aMXe8gNN0RlohOctKS9HypgX4g== 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 4Y4QzY6l7NzYGq; Fri, 6 Dec 2024 09:33:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4B69XDCV036844; Fri, 6 Dec 2024 09:33:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B69XDci036840; Fri, 6 Dec 2024 09:33:13 GMT (envelope-from git) Date: Fri, 6 Dec 2024 09:33:13 GMT Message-Id: <202412060933.4B69XDci036840@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Tom Jones Subject: git: f132be9bac5f - main - netgraph: Enable support for EIM NAT List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: thj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f132be9bac5f29e844e8dde4f3a70f4c3c158221 Auto-Submitted: auto-generated The branch main has been updated by thj: URL: https://cgit.FreeBSD.org/src/commit/?id=f132be9bac5f29e844e8dde4f3a70f4c3c158221 commit f132be9bac5f29e844e8dde4f3a70f4c3c158221 Author: Damjan Jovanovic AuthorDate: 2024-12-06 09:31:58 +0000 Commit: Tom Jones CommitDate: 2024-12-06 09:31:58 +0000 netgraph: Enable support for EIM NAT Enable support for endpoint-independent mapping ("full cone NAT") via Libalias's UDP NAT. Reviewed by: igoro, thj Differential Revision: https://reviews.freebsd.org/D46689 --- share/man/man4/ng_nat.4 | 3 ++- sys/netgraph/ng_nat.c | 2 ++ sys/netgraph/ng_nat.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/share/man/man4/ng_nat.4 b/share/man/man4/ng_nat.4 index bf9ec4052733..20042db7a1af 100644 --- a/share/man/man4/ng_nat.4 +++ b/share/man/man4/ng_nat.4 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 24, 2021 +.Dd December 6, 2024 .Dt NG_NAT 4 .Os .Sh NAME @@ -74,6 +74,7 @@ struct ng_nat_mode { #define NG_NAT_PROXY_ONLY 0x40 #define NG_NAT_REVERSE 0x80 #define NG_NAT_UNREGISTERED_CGN 0x100 +#define NG_NAT_UDP_EIM 0x200 .Ed .Pp The corresponding libalias flags can be found by replacing the diff --git a/sys/netgraph/ng_nat.c b/sys/netgraph/ng_nat.c index e9de0e5b60c8..defbe817becd 100644 --- a/sys/netgraph/ng_nat.c +++ b/sys/netgraph/ng_nat.c @@ -967,6 +967,8 @@ ng_nat_translate_flags(unsigned int x) res |= PKT_ALIAS_REVERSE; if (x & NG_NAT_UNREGISTERED_CGN) res |= PKT_ALIAS_UNREGISTERED_CGN; + if (x & NG_NAT_UDP_EIM) + res |= PKT_ALIAS_UDP_EIM; return (res); } diff --git a/sys/netgraph/ng_nat.h b/sys/netgraph/ng_nat.h index 73f09459a84c..9b092b7749f0 100644 --- a/sys/netgraph/ng_nat.h +++ b/sys/netgraph/ng_nat.h @@ -53,6 +53,7 @@ struct ng_nat_mode { #define NG_NAT_PROXY_ONLY 0x40 #define NG_NAT_REVERSE 0x80 #define NG_NAT_UNREGISTERED_CGN 0x100 +#define NG_NAT_UDP_EIM 0x200 #define NG_NAT_DESC_LENGTH 64 #define NG_NAT_REDIRPROTO_ADDR (IPPROTO_MAX + 3) /* LibAlias' LINK_ADDR, also unused in in.h */