[Devel] [PATCH RHEL9 COMMIT] ve: fix compilation warning in nf_log_allowed_ve

Konstantin Khorenko khorenko at virtuozzo.com
Mon Jan 9 19:57:29 MSK 2023


The commit is pushed to "branch-rh9-5.14.0-162.6.1.vz9.18.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-162.6.1.el9
------>
commit 404122cb99976fc8a01eb525e964b6bb45c5ac74
Author: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Date:   Fri Jan 6 15:02:10 2023 +0300

    ve: fix compilation warning in nf_log_allowed_ve
    
    net/netfilter/nf_log_syslog.c: In function 'nf_log_allowed_ve':
    net/netfilter/nf_log_syslog.c:52:31: warning: passing argument 1 of 'is_ve_init_net' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
       52 |         return is_ve_init_net(net) || sysctl_nf_log_all_netns;
          |                               ^~~
    In file included from net/netfilter/nf_log_syslog.c:19:
    ./include/linux/ve.h:222:40: note: expected 'struct net *' but argument is of type 'const struct net *'
      222 | extern bool is_ve_init_net(struct net *net);
          |                            ~~~~~~~~~~~~^~~
    
    Fixes: e817f12be9be ("ve/nf_log_syslog: allow packet logging in ve init netns")
    
    Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 kernel/ve/ve.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c
index 8f15aefcd6d0..e6b76e9b6175 100644
--- a/kernel/ve/ve.c
+++ b/kernel/ve/ve.c
@@ -297,7 +297,7 @@ struct net *ve_get_net_ns(struct ve_struct* ve)
 }
 EXPORT_SYMBOL(ve_get_net_ns);
 
-bool is_ve_init_net(struct net *net)
+bool is_ve_init_net(const struct net *net)
 {
 	struct ve_struct *ve = net->owner_ve;
 	struct nsproxy *ve_ns;


More information about the Devel mailing list