Summary: | Firewall module does not support netmasks | ||
---|---|---|---|
Product: | [Applications] systemsettings | Reporter: | Alve <alve> |
Component: | kcm_firewall | Assignee: | Plasma Bugs List <plasma-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | nate, tcanabrava, thebluequasar |
Priority: | NOR | ||
Version: | 5.21.2 | ||
Target Milestone: | --- | ||
Platform: | Archlinux | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/plasma/plasma-firewall/commit/8bb9853f7fc6ddc8fd72d7bf4079713aa36008c6 | Version Fixed In: | 5.27 |
Description
Alve
2021-03-12 10:59:05 UTC
(the crash occurs when having added a rule using the command line and then going to the page and then from it and then back to it, the backtrace is therefore partially unrelated to this bug!) I'm doing this week a firewall mini hackaton where I'll try to add this and other improvements. Git commit 867e5824387344f0795382b17dcf37ab1b5f5cdc by Daniel Vrátil. Committed on 20/06/2022 at 14:48. Pushed by dvratil into branch 'feature/ip-netmask'. Allow IP addresses with netmask in advanced rule editor Especially for firewall configuration, it's very much useful to be able to allow or block subnets (e.g. I want to allow all traffic originating on trusted part of my home network). Both UFW and firewalld to accept IP addresses with netmask, so it is just about allowing them in the input's validtors. I decided to replace the regular expressions with a custom QValidator subclass, which uses lib'c inet_pton() to validate the entered IP address and can also handle optional netmasks. CHANGELOG: Allow IP addresses with netmask in advanced rule editor M +2 -0 CMakeLists.txt A +3 -0 autotests/CMakeLists.txt A +72 -0 autotests/ipvalidatortest.cpp [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)] M +2 -0 kcm/core/CMakeLists.txt A +102 -0 kcm/core/ipvalidator.cpp [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)] A +31 -0 kcm/core/ipvalidator.h [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)] M +2 -0 kcm/kcm.cpp M +3 -7 kcm/package/contents/ui/IpTextField.qml https://invent.kde.org/plasma/plasma-firewall/commit/867e5824387344f0795382b17dcf37ab1b5f5cdc A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-firewall/-/merge_requests/47 Git commit 8bb9853f7fc6ddc8fd72d7bf4079713aa36008c6 by Daniel Vrátil. Committed on 19/10/2022 at 15:48. Pushed by dvratil into branch 'master'. Allow IP addresses with netmask in advanced rule editor Especially for firewall configuration, it's very much useful to be able to allow or block subnets (e.g. I want to allow all traffic originating on trusted part of my home network). Both UFW and firewalld do accept IP addresses with netmask, so it is just about allowing them in the input's validtors. I decided to replace the regular expressions with a custom QValidator subclass, which uses lib'c inet_pton() to validate the entered IP address and can also handle optional netmasks. CHANGELOG: Allow IP addresses with netmask in advanced rule editor M +2 -0 CMakeLists.txt A +3 -0 autotests/CMakeLists.txt A +72 -0 autotests/ipvalidatortest.cpp [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)] M +2 -0 kcm/core/CMakeLists.txt A +107 -0 kcm/core/ipvalidator.cpp [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)] A +31 -0 kcm/core/ipvalidator.h [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)] M +2 -0 kcm/kcm.cpp M +3 -7 kcm/package/contents/ui/IpTextField.qml https://invent.kde.org/plasma/plasma-firewall/commit/8bb9853f7fc6ddc8fd72d7bf4079713aa36008c6 *** Bug 461725 has been marked as a duplicate of this bug. *** |