On Mon, Jul 1, 2013 at 3:28 PM, Pravin B Shelar <[email protected]> wrote: > diff --git a/datapath/linux/compat/net_namespace.c > b/datapath/linux/compat/net_namespace.c > index 4e8a891..39b4a28 100644 > --- a/datapath/linux/compat/net_namespace.c > +++ b/datapath/linux/compat/net_namespace.c > int rpl_register_pernet_##PNET_TYPE(struct rpl_pernet_operations *rpl_pnet) > \ > { > \ > pnet_##PNET_TYPE = rpl_pnet; > \ > - return register_pernet_##PNET_TYPE(pnet_##PNET_TYPE->id, > &pnet_compat_##PNET_TYPE); \ > + rpl_pnet->ops = pnet_compat_##PNET_TYPE; > \ > + return register_pernet_##PNET_TYPE(pnet_##PNET_TYPE->id, > &rpl_pnet->ops); \ > }
I think this works for initializing the device for existing namespaces but if a new namespace is brought up then it will have problems. In that case, it will call the registration function for the last device repeatedly. We could avoid this issue if we just used contain_of instead of a set of global variables to recover the original ops. That might also allow us to significantly reduce the amount of token pasting, which would also make this easier to read. X-CudaMail-Whitelist-To: [email protected] _______________________________________________ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
