mark: the rule's connections send with a mark (#846)

mark <number> extends the allow or deny rule above it, as nolog and
weight do: a connection the rule lets through carries the mark on its
outgoing sockets, towards the destination and towards the parents, so
policy routing and firewall rules can tell its packets apart (SO_MARK
of Linux, SO_USER_COOKIE of FreeBSD; on a system with no mark the
command sets it to nothing). The UDP sockets of a session towards a
destination are marked the same, the SOCKS UDP ASSOCIATE relays among
them, for the rule that let the session through is looked up for each
destination. A mark with no rule above it, or not a number, is refused.
This commit is contained in:
Vladimir Dubrovin committed 2026-11-21 16:40:53 +03:00
1 parent e193732fcd
commit a2e400622b
9 files changed
+127 -9

No files matched your search

+2
View File
@@ -407,6 +407,7 @@ struct ace {
int wdays;
int weight;
int nolog;
int mark;
struct period *periods;
struct userlist *users;
struct iplist *src, *dst;
@@ -819,6 +820,7 @@ struct clientparam {
int pwtype,
weight,
nolog,
mark,
nolongdatfilter,
nosplice, /* a TLS socket of the connection is not in the kernel */
nooverwritefilter,