On Wed, Sep 16, 2015 at 3:00 PM, Jesse Gross <[email protected]> wrote: > On Tue, Sep 15, 2015 at 11:09 AM, Pravin B Shelar <[email protected]> wrote: >> Signed-off-by: Pravin B Shelar <[email protected]> > > What about this commit? > openvswitch: allocate nr_node_ids flow_stats instead of num_possible_nodes > ok, I will send separate patch. >> diff --git a/datapath/linux/compat/socket.c b/datapath/linux/compat/socket.c >> new file mode 100644 >> index 0000000..776f9e2 >> --- /dev/null >> +++ b/datapath/linux/compat/socket.c >> +#ifndef HAVE_SOCK_CREATE_KERN_NET >> +int ovs_sock_create_kern(struct net *net, int family, int type, int >> protocol, struct socket **res) >> +{ >> + int err; >> + >> + err = sock_create_kern(family, type, protocol, res); >> + if (err < 0) >> + return err; >> + >> + sk_change_net((*res)->sk, net); >> + return err; >> +} >> + >> +void ovs_sock_release(struct socket *sock) >> +{ >> + sk_release_kernel(sock->sk); >> +} >> +#endif > > Is there a reason we can't use a macro and then keep the original > name? I'm also not sure that we need to put this in a new .c file but > that's more just personal opinion.
I also likes to define it in header but there is issue with it. I need to call sk_change_net() which is defined in sock.h. I do not want to include header from different compat header file. I causes all sorts of header dependencies. I changed name since it is no longer same API, it also calls sk_change_net(). _______________________________________________ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
