netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* FreeSWAN's pfkey_v2.c
@ 2002-10-17  2:48 Michael Richardson
  2002-10-17  2:50 ` Andi Kleen
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Richardson @ 2002-10-17  2:48 UTC (permalink / raw)
  To: design; +Cc: netdev

-----BEGIN PGP SIGNED MESSAGE-----


In our pfkey_v2.c, we had:

struct proto_ops SOCKOPS_WRAPPED(pfkey_ops);
...
pfkey_create() {
sock->ops = &SOCKOPS_WRAPPED(pfkey_ops);
}
...
struct proto_ops SOCKOPS_WRAPPED(pfkey_ops) = {
}

#ifdef NETDEV_23
#include <linux/smp_lock.h>
SOCKOPS_WRAP(pfkey, PF_KEY);
#endif /* NETDEV_23 */

When building with -Werror, we get a fatal error when SMP is defined, because
we get a pfkey_ops which is never used.

I believe that the error is that we should not be initializing the sock->ops
to the WRAPPED version, but rather to "pfkey_ops", so that we actually are
using the wrapped functions which lock stuff.

I.e. we never actually were using the interface which the SOCKOPS_WRAP()
macro so meticulously created for us.

We probably haven't hit a problem before, because we tend to run on
uniprocessors a lot, and we also tend to have only one single threaded
process (pluto) that talks PF_KEY.

I am looking for confirmation from network stack people that my conclusions
from reading of the macros in linux/net.h is correct.

]       ON HUMILITY: to err is human. To moo, bovine.           |  firewalls  [
]   Michael Richardson, Sandelman Software Works, Ottawa, ON    |net architect[
] mcr@sandelman.ottawa.on.ca http://www.sandelman.ottawa.on.ca/ |device driver[
] panic("Just another Debian GNU/Linux using, kernel hacking, security guy"); [


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: Finger me for keys

iQCVAwUBPa4k44qHRg3pndX9AQHArwQAmePHXduPugmIQemek8PDx7spY82uN25u
MlZu+uuuGK1k0YvOiOLJUyaCmhdXRGtYOKd+GoDHVX5NJsnI7AbJzTmhy2H8DjZI
/gR8sblD3w6Q/Fi/M4jQvLdsNSWZVSoMR1tnsRLorfQva8C737LTJ8Ipa9KrnWNH
qx/0EyQnQ3o=
=6xM7
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-10-17  3:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-17  2:48 FreeSWAN's pfkey_v2.c Michael Richardson
2002-10-17  2:50 ` Andi Kleen
2002-10-17  2:53   ` Arnaldo Carvalho de Melo
2002-10-17  3:58   ` Michael Richardson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).