On 18/09/17 13:18, Antonio Quartulli wrote: > Hi, > > On 17/09/17 20:00, Steffan Karger wrote: > > [CUT] > >>> @@ -101,4 +104,16 @@ void pf_context_print(const struct pf_context *pfc, >>> const char *prefix, const in >>> >>> #endif >>> >>> +bool pf_c2c_test(const struct context *src, const struct context *dest, >>> + const char *prefix); >>> + >>> +bool pf_addr_test(const struct context *src, const struct mroute_addr >>> *dest, >>> + const char *prefix); >> >> Why are these no longer inline? They seem to be simple wrappers to >> prevent a function call is pf is not enabled. >> > > Oh, I needed sometime, but then I understood what you mean :) > > You are saying that by keeping this function inline, we have a slight > performance gain because we won't invoke pf_cn_test() when pf is > disabled. And such decision can be made inline.
Now I recall why I changed that. pf_c2c_test is dereferencing an object of type "struct context" for which we have no definition available at that point. A fix could be to include openvpn.h in pf.h, but then we get other weird problems due to circular inclusions. Having pf-inline.h was, of course, much easier because you could place its inclusion at the most convenient place and the problem was solved. I'll try to restructure the functions a bit so that we don't lose the gain given by the inline attribute, but we don't need to dereference the context as well. Cheers, > > > I agree. I will send a v2 of this patch. > > >>> >> >> Otherwise this patch looks good. > > Thanks for reviewing! > > Cheers, > > > > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > > > _______________________________________________ > Openvpn-devel mailing list > Openvpn-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/openvpn-devel > -- Antonio Quartulli
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel