acl: the targetlist names the service by its addresses, too
C/C++ CI Linux / ubuntu-24.04-arm (push) Canceled after 0s
C/C++ CI Linux / ubuntu-latest (push) Canceled after 0s
C/C++ CI MacOS / macos-15 (push) Canceled after 0s
C/C++ CI Windows / windows-2022 (push) Canceled after 0s
C/C++ CI cmake / macos-15 (push) Canceled after 0s
C/C++ CI cmake / ubuntu-24.04-arm (push) Canceled after 0s
C/C++ CI cmake / ubuntu-latest (push) Canceled after 0s
C/C++ CI cmake / windows-2022 (push) Canceled after 0s
C/C++ CI cmake / ubuntu-latest (wolfSSL) (push) Canceled after 0s

One @ in the targetlist and one in the targetportlist delimit the lists
of destinations from the lists of the services the request came
through — the addresses it listens on in the first, its ports in the
second, both sides written as any other list:

 allow * * 192.168.1.0/24@10.0.0.1 443@1080,1090

matches only requests of the service on 10.0.0.1:1080 or :1090. A side
of the @ may be left out: @1080 names a port alone, *@10.0.0.1 an
address alone, and an @ with nothing after it is refused; an IPv6
address needs no brackets there, no port follows it.

The targetlist and the targetportlist are parsed by the same functions
now — ipadd() over scanipl() and portadd() — the chains of inline
allocations in make_ace() gone, and with them the mixed form of a
service named by an address and a port behind one @, which the two
fields make unnecessary.
This commit is contained in:
Vladimir Dubrovin committed 2026-11-23 16:35:11 +03:00
1 parent 84737399f2
commit 642ef96272
3 files changed
+73 -116

No files matched your search

+16 -10
View File
@@ -936,20 +936,26 @@ quoted or written \fB$$\fR, since a lone dollar outside quotes begins the name
of a file to include. The same patterns, and the same prefix, are used by the
\fBhttp\fR command, see BUILT IN HTTP SERVER. Regular expressions are matched
per request and cost more than a wildmask, which is enough for most rules.
Targetportlist may contain ports (X) or port ranges lists (X-Y). A port may
carry the service the request came through after an @, as X-Y@S or, for any
destination, @S: the rule matches only requests that arrived through the
service S — the address it listens on, its port, or both, the address in
brackets when IPv6 (@1080, @10.0.0.1, @10.0.0.1:1080, @[::1]:1080). The
limiters are shared by all the services, so this is how a limit is given to
one service's connections alone, e.g.
Targetlist and targetportlist may name, after one @, the service the
request came through: the targetlist by the addresses it listens on,
the targetportlist by its ports, the lists before and after the @ each
written as any other —
.br
allow * * 192.168.1.0/24@10.0.0.1 443@1080,1090
.br
matches only requests of the service on 10.0.0.1:1080 or :1090. A side
of the @ may be left out: * (any) before it, or nothing after it —
@1080 names a port alone, *@10.0.0.1 an address alone, and an @ with
nothing after it is refused. An IPv6 address needs no brackets there,
for no port follows it. The limiters are shared by all the services,
so this is how a limit is given to one service's connections alone:
.br
connlim 5 60 * * * @1080
.br
denies the sixth concurrent connection of the service on port 1080,
whatever it connects to. A comma ends an entry, so several services are
listed by repeating it: *@1080,*@1090 names the two, and a bare
@1080,1090 would leave 1090 a destination port. For any field *
whatever it connects to. For any field *
sign means ANY. If access list is empty it\'s assumed to be
.br
allow *