Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release Notes: - [1.0.9](https://www.netfilter.org/projects/nftables/files/changes-nftables-1.0.9.txt) - [1.0.8](https://www.netfilter.org/projects/nftables/files/changes-nftables-1.0.8.txt) Additional Changes: - Subpackage python library - Make stateless Signed-off-by: Reilly Brogan <reilly@reillybrogan.com>
- Loading branch information
1 parent
9da6638
commit c246a52
Showing
8 changed files
with
186 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 0 additions & 39 deletions
39
packages/n/nftables/files/0001-Replace-distutils-with-setuptools.patch
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Reilly Brogan <reilly@reillybrogan.com> | ||
Date: Sat, 20 Apr 2024 15:44:38 -0500 | ||
Subject: [PATCH] Stateless | ||
|
||
--- | ||
files/osf/Makefile.am | 2 +- | ||
src/ct.c | 9 ++++++++- | ||
src/libnftables.c | 2 ++ | ||
src/nfnl_osf.c | 14 +++++++++++++- | ||
4 files changed, 24 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/files/osf/Makefile.am b/files/osf/Makefile.am | ||
index d80196dd..b7f4c8ff 100644 | ||
--- a/files/osf/Makefile.am | ||
+++ b/files/osf/Makefile.am | ||
@@ -1,2 +1,2 @@ | ||
-pkgsysconfdir = ${sysconfdir}/nftables/osf | ||
+pkgsysconfdir = /usr/share/defaults/etc/nftables/osf | ||
dist_pkgsysconf_DATA = pf.os | ||
diff --git a/src/ct.c b/src/ct.c | ||
index 1dda799d..48237b82 100644 | ||
--- a/src/ct.c | ||
+++ b/src/ct.c | ||
@@ -28,10 +28,12 @@ | ||
#include <datatype.h> | ||
#include <ct.h> | ||
#include <gmputil.h> | ||
+#include <unistd.h> | ||
#include <utils.h> | ||
#include <statement.h> | ||
|
||
#define CONNLABEL_CONF DEFAULT_INCLUDE_PATH "/connlabel.conf" | ||
+#define CONNLABEL_CONF_VENDOR "/usr/share/defaults/etc/connlabel.conf" | ||
|
||
static const struct symbol_table ct_state_tbl = { | ||
.base = BASE_HEXADECIMAL, | ||
@@ -230,7 +232,12 @@ const struct datatype ct_label_type = { | ||
|
||
void ct_label_table_init(struct nft_ctx *ctx) | ||
{ | ||
- ctx->output.tbl.ct_label = rt_symbol_table_init(CONNLABEL_CONF); | ||
+ if (access(CONNLABEL_CONF, F_OK) == 0) { | ||
+ ctx->output.tbl.ct_label = rt_symbol_table_init(CONNLABEL_CONF); | ||
+ } | ||
+ else { | ||
+ ctx->output.tbl.ct_label = rt_symbol_table_init(CONNLABEL_CONF_VENDOR); | ||
+ } | ||
} | ||
|
||
void ct_label_table_exit(struct nft_ctx *ctx) | ||
diff --git a/src/libnftables.c b/src/libnftables.c | ||
index 41f54c0c..3fba8286 100644 | ||
--- a/src/libnftables.c | ||
+++ b/src/libnftables.c | ||
@@ -202,6 +202,8 @@ struct nft_ctx *nft_ctx_new(uint32_t flags) | ||
|
||
ctx->state = xzalloc(sizeof(struct parser_state)); | ||
nft_ctx_add_include_path(ctx, DEFAULT_INCLUDE_PATH); | ||
+ // Add the Solus stateless path | ||
+ nft_ctx_add_include_path(ctx, "/usr/share/defaults/etc"); | ||
ctx->parser_max_errors = 10; | ||
cache_init(&ctx->cache.table_cache); | ||
ctx->top_scope = scope_alloc(); | ||
diff --git a/src/nfnl_osf.c b/src/nfnl_osf.c | ||
index 20a1bfe7..793d3f5b 100644 | ||
--- a/src/nfnl_osf.c | ||
+++ b/src/nfnl_osf.c | ||
@@ -351,6 +351,7 @@ static int osf_load_line(char *buffer, int len, int del, | ||
} | ||
|
||
#define OS_SIGNATURES DEFAULT_INCLUDE_PATH "/nftables/osf/pf.os" | ||
+#define OS_SIGNATURES_VENDOR "/usr/share/defaults/etc/nftables/osf/pf.os" | ||
|
||
int nfnl_osf_load_fingerprints(struct netlink_ctx *ctx, int del) | ||
{ | ||
@@ -368,7 +369,18 @@ int nfnl_osf_load_fingerprints(struct netlink_ctx *ctx, int del) | ||
nft_print(&ctx->nft->output, "Failed to open file '%s'\n", | ||
OS_SIGNATURES); | ||
|
||
- return -1; | ||
+ if (ctx->nft->debug_mask & NFT_DEBUG_MNL) | ||
+ nft_print(&ctx->nft->output, "Opening OS Vendor signature file '%s'\n", | ||
+ OS_SIGNATURES_VENDOR); | ||
+ // Try to open the vendor one | ||
+ inf = fopen(OS_SIGNATURES_VENDOR, "r"); | ||
+ if (!inf) { | ||
+ if (ctx->nft->debug_mask & NFT_DEBUG_MNL) | ||
+ nft_print(&ctx->nft->output, "Failed to open vendor file '%s'\n", | ||
+ OS_SIGNATURES_VENDOR); | ||
+ | ||
+ return -1; | ||
+ } | ||
} | ||
|
||
while (fgets(buf, sizeof(buf), inf)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
releases: | ||
id: 2082 | ||
rss: ~ | ||
security: | ||
# No known CPE, last checked 2024-04-20 | ||
cpe: ~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.