]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
network: Drop const for forwardIf in pfAddNatFirewallRules()
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 8 Jan 2026 15:57:19 +0000 (16:57 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 15 Jan 2026 10:16:53 +0000 (11:16 +0100)
The 'forwardIf' variable inside of pfAddNatFirewallRules() is
declared as both g_autofree and const. This makes no sense.
Since the variable is g_strdup()-ed into right in the
declaration, it's not const. Drop that part of variable
declaration.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
src/network/network_pf.c

index 34e2f60e821de0b38bef4fda15ebef41c011dd0a..724b82c05406cea72c5caa40e547e657a456492c 100644 (file)
@@ -165,7 +165,7 @@ pfAddNatFirewallRules(virNetworkDef *def,
      * block log on virbr0
      */
     int prefix = virNetworkIPDefPrefix(ipdef);
-    g_autofree const char *forwardIf = g_strdup(virNetworkDefForwardIf(def, 0));
+    g_autofree char *forwardIf = g_strdup(virNetworkDefForwardIf(def, 0));
     g_auto(virBuffer) pf_rules_buf = VIR_BUFFER_INITIALIZER;
     g_autoptr(virCommand) cmd = virCommandNew(PFCTL);
     g_autoptr(virCommand) flush_cmd = virCommandNew(PFCTL);