Received: by 10.223.164.221 with SMTP id h29csp2752040wrb; Sun, 15 Oct 2017 07:19:01 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAh9wUDWjrSzeumCQaOi1hPHvpEYKl8VfbgSvNJZhk5+oOB+0EWU/vELihVs/pOhm+7+AyM X-Received: by 10.159.253.75 with SMTP id b11mr6353172plx.93.1508077141461; Sun, 15 Oct 2017 07:19:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508077141; cv=none; d=google.com; s=arc-20160816; b=M4bTVjtLh9lpRH2p3XGu6H4W84Oik1Z19Pqxx790i7NwZHbxyZV40uGMhANrKm1bW4 SGOkLSqt2GaccJuQka8cS/OcronrPIhMuEIDU/j1mVJavXWghbwuZpp0o2yQzsT7XjrO XYfBdkaDx8OcmV5gIIXRLgS0oAntc2SjCtsscEt8S9YAbwgxZxS7jDbaKRfxwsKJQ18q ea5w17omwUsZUJZIugEe0kll1utb2WtLVLvT4H2Rg9/lN61RKrcGkxsmelqhzyJkvl0e fdn+3XAWMi5XgfyX2FRLmU7SVF0gyuAC6jhH9cNt3xSF3dzeIXZs44tgtrveK4HogyxM AFtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=4JjPqWQCnOg+4N8QQK9DfWIfQiIxV6fy9WW9K3uYgeE=; b=azHspnbnOL/9dN9hb+Auqi1r9qa80X+v07sGUvf+EvCoPuV7H+neTB1i7hGKJpZFoQ a8YttMuHg7nbBvj5a3feJ7mPghjhOA8ZFA9fREPsqzFgy+UoxNyNZB4PGI8uNmLLA7ec uxD8TNhmtf+dpXkUSjoD839U6jToQ9w7XSkr0RpXDKsurnhvdAUW6BzCnEmksjtWFSG6 JrxhvZYquo82+dWMcvTTIjNNM8SKrmqsZ25akIS6zceqXbOcveNLPCpSJ+lOUGdDrcop hDxAlcEKPSA+FROYGzL/bZRyRLwlG/vOiGlvj0wqbOcKL0YGQgUReUTmRZ+mZBsRdlEY pQHQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v11si1533009plp.88.2017.10.15.07.18.38; Sun, 15 Oct 2017 07:19:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751904AbdJOOSC (ORCPT + 99 others); Sun, 15 Oct 2017 10:18:02 -0400 Received: from ja.ssi.bg ([178.16.129.10]:33648 "EHLO ja.ssi.bg" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751386AbdJOOSA (ORCPT ); Sun, 15 Oct 2017 10:18:00 -0400 X-Greylist: delayed 342 seconds by postgrey-1.27 at vger.kernel.org; Sun, 15 Oct 2017 10:17:59 EDT Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by ja.ssi.bg (8.15.2/8.15.2) with ESMTP id v9FEBSoq007315; Sun, 15 Oct 2017 17:11:28 +0300 Date: Sun, 15 Oct 2017 17:11:28 +0300 (EEST) From: Julian Anastasov To: KUWAZAWA Takuya cc: Wensong Zhang , Simon Horman , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , netdev@vger.kernel.org, lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ipvs: Fix inappropriate output of procfs In-Reply-To: <20171015115406.GA11429@nuc02.localdomain> Message-ID: References: <20171015115406.GA11429@nuc02.localdomain> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Sun, 15 Oct 2017, KUWAZAWA Takuya wrote: > Information about ipvs in different network namespace can be seen via procfs. > > How to reproduce: > > # ip netns add ns01 > # ip netns add ns02 > # ip netns exec ns01 ip a add dev lo 127.0.0.1/8 > # ip netns exec ns02 ip a add dev lo 127.0.0.1/8 > # ip netns exec ns01 ipvsadm -A -t 10.1.1.1:80 > # ip netns exec ns02 ipvsadm -A -t 10.1.1.2:80 > > The ipvsadm displays information about its own network namespace only. > > # ip netns exec ns01 ipvsadm -Ln > IP Virtual Server version 1.2.1 (size=4096) > Prot LocalAddress:Port Scheduler Flags > -> RemoteAddress:Port Forward Weight ActiveConn InActConn > TCP 10.1.1.1:80 wlc > > # ip netns exec ns02 ipvsadm -Ln > IP Virtual Server version 1.2.1 (size=4096) > Prot LocalAddress:Port Scheduler Flags > -> RemoteAddress:Port Forward Weight ActiveConn InActConn > TCP 10.1.1.2:80 wlc > > But I can see information about other network namespace via procfs. > > # ip netns exec ns01 cat /proc/net/ip_vs > IP Virtual Server version 1.2.1 (size=4096) > Prot LocalAddress:Port Scheduler Flags > -> RemoteAddress:Port Forward Weight ActiveConn InActConn > TCP 0A010101:0050 wlc > TCP 0A010102:0050 wlc > > # ip netns exec ns02 cat /proc/net/ip_vs > IP Virtual Server version 1.2.1 (size=4096) > Prot LocalAddress:Port Scheduler Flags > -> RemoteAddress:Port Forward Weight ActiveConn InActConn > TCP 0A010102:0050 wlc > > Signed-off-by: KUWAZAWA Takuya Looks good to me Acked-by: Julian Anastasov Simon, please apply to ipvs tree. > --- > net/netfilter/ipvs/ip_vs_ctl.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c > index 4f940d7..b3245f9 100644 > --- a/net/netfilter/ipvs/ip_vs_ctl.c > +++ b/net/netfilter/ipvs/ip_vs_ctl.c > @@ -2034,12 +2034,16 @@ static int ip_vs_info_seq_show(struct seq_file *seq, void *v) > seq_puts(seq, > " -> RemoteAddress:Port Forward Weight ActiveConn InActConn\n"); > } else { > + struct net *net = seq_file_net(seq); > + struct netns_ipvs *ipvs = net_ipvs(net); > const struct ip_vs_service *svc = v; > const struct ip_vs_iter *iter = seq->private; > const struct ip_vs_dest *dest; > struct ip_vs_scheduler *sched = rcu_dereference(svc->scheduler); > char *sched_name = sched ? sched->name : "none"; > > + if (svc->ipvs != ipvs) > + return 0; > if (iter->table == ip_vs_svc_table) { > #ifdef CONFIG_IP_VS_IPV6 > if (svc->af == AF_INET6) > -- > 1.8.3.1 Regards -- Julian Anastasov From 1581324432858368820@xxx Sun Oct 15 11:54:57 +0000 2017 X-GM-THRID: 1581324432858368820 X-Gmail-Labels: Inbox,Category Forums