OpenVZ Forum


Home » Mailing lists » Devel » [PATCH 1/12] L2 network namespace: current network namespace operations
Re: [PATCH 1/12] L2 network namespace: current network namespace operations [message #16853 is a reply to message #16849] Thu, 07 December 2006 11:23 Go to previous messageGo to previous message
Mishin Dmitry is currently offline  Mishin Dmitry
Messages: 112
Registered: February 2006
Senior Member
On Thursday 07 December 2006 12:37, Cedric Le Goater wrote:
> Dmitry Mishin wrote:
> > Added functions and macros required to operate with current network namespaces.
> > They are required in order to switch network namespace for incoming packets and
> > to not extend current network interface by addtiotional network namespace argue.
> > 
> > Signed-off-by: Dmitry Mishin <dim@openvz.org>
> > 
> > ---
> >  include/linux/net_namespace.h |   41 +++++++++++++++++++++++++++++++++++++++--
> >  kernel/nsproxy.c              |    1 +
> >  net/core/net_namespace.c      |    2 ++
> >  3 files changed, 42 insertions(+), 2 deletions(-)
> > 
> > --- linux-2.6.19-rc6-mm2.orig/include/linux/net_namespace.h
> > +++ linux-2.6.19-rc6-mm2/include/linux/net_namespace.h
> > @@ -7,6 +7,7 @@
> >  
> >  struct net_namespace {
> >  	struct kref	kref;
> > +	struct nsproxy	*ns;
> >  };
> >
> 
> why do you need that back pointer ? 
> 
> ( The answer must be in the following patches but I'm being lazy and 
>   asking the author :)
Because for the incoming packets, I need to switch networking namespace
per-task and not per-nsproxy. If I switch it just in current->nsproxy, it means
that all tasks shring this nsproxy will switch network context.

It is one of the reasons, why we need per-task exec_context pointer.


-- 
Thanks,
Dmitry.
_______________________________________________
Containers mailing list
Containers@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: semantics for namespace naming
Next Topic: seems to be a flaw in cfq
Goto Forum:
  


Current Time: Wed Aug 14 22:26:47 GMT 2024

Total time taken to generate the page: 0.02713 seconds