* [pve-devel] [PATCH pve-firewall 1/1] fix #5925: vnet: add parsing logic for log_level_forward
@ 2024-11-25 14:30 Stefan Hanreich
2024-11-25 20:58 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Hanreich @ 2024-11-25 14:30 UTC (permalink / raw)
To: pve-devel
We currently don't parse the log_level_forward option from the vnet
configuration, which leads to the value not being returned from the
API and always showing up as the default nolog value.
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
src/PVE/Firewall.pm | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/PVE/Firewall.pm b/src/PVE/Firewall.pm
index 1db6c51..533f2a2 100644
--- a/src/PVE/Firewall.pm
+++ b/src/PVE/Firewall.pm
@@ -3053,12 +3053,17 @@ sub parse_vnetfw_option {
my ($opt, $value);
+ my $loglevels = "emerg|alert|crit|err|warning|notice|info|debug|nolog";
+
if ($line =~ m/^(enable):\s*(\d+)\s*$/i) {
$opt = lc($1);
$value = int($2);
} elsif ($line =~ m/^(policy_forward):\s*(ACCEPT|DROP)\s*$/i) {
$opt = lc($1);
$value = uc($2);
+ } elsif ($line =~ m/^(log_level_forward):\s*($loglevels)\s*$/i) {
+ $opt = lc($1);
+ $value = lc($2);
} else {
die "can't parse option '$line'\n"
}
--
2.39.5
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pve-devel] applied: [PATCH pve-firewall 1/1] fix #5925: vnet: add parsing logic for log_level_forward
2024-11-25 14:30 [pve-devel] [PATCH pve-firewall 1/1] fix #5925: vnet: add parsing logic for log_level_forward Stefan Hanreich
@ 2024-11-25 20:58 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2024-11-25 20:58 UTC (permalink / raw)
To: Proxmox VE development discussion, Stefan Hanreich
Am 25.11.24 um 15:30 schrieb Stefan Hanreich:
> We currently don't parse the log_level_forward option from the vnet
> configuration, which leads to the value not being returned from the
> API and always showing up as the default nolog value.
>
> Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
> ---
> src/PVE/Firewall.pm | 5 +++++
> 1 file changed, 5 insertions(+)
>
>
applied, thanks!
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-11-25 20:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-25 14:30 [pve-devel] [PATCH pve-firewall 1/1] fix #5925: vnet: add parsing logic for log_level_forward Stefan Hanreich
2024-11-25 20:58 ` [pve-devel] applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox