]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commit
fwhosts.cgi: Fix check to limit amount of ports in custom service groups.
authorStefan Schantl <stefan.schantl@ipfire.org>
Thu, 15 Jul 2021 10:07:37 +0000 (12:07 +0200)
committerPeter Müller <peter.mueller@ipfire.org>
Fri, 19 Nov 2021 06:13:42 +0000 (07:13 +0100)
commit0341e11fe1f80b569957d23e688a0771c474691a
tree0615333f1ea86f5b0a80aaf4f43437b5ca55868a
parentfe6b3e502b1ea2d6b66a2cd157aa842bcb5378e7
fwhosts.cgi: Fix check to limit amount of ports in custom service groups.

iptables multiport only supports up to 15 elements for each protocol (TCP or UDP).
That can be single ports or portranges (they count doubble).

This commit extends the check to calculate the amount of used TCP and/or
UDP ports of all existing entries in a group, by increasing the amount
for the service which should be added.

If the amount of ports for TCP or UDP ports become greater than the
limit of 15 the error message will be displayed.

Fixes #11323.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
html/cgi-bin/fwhosts.cgi