[IPSEC]: Store afinfo pointer in xfrm_mode
commit17c2a42a24e1e8dd6aa7cea4f84e034ab1bfff31
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 18 Oct 2007 04:33:12 +0000 (17 21:33 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 Oct 2007 04:33:12 +0000 (17 21:33 -0700)
tree3ee494a16a43f575f8c4900deaab894b73b2953a
parent1bfcb10f670f5ff5e1d9f53e59680573524cb142
[IPSEC]: Store afinfo pointer in xfrm_mode

It is convenient to have a pointer from xfrm_state to address-specific
functions such as the output function for a family.  Currently the
address-specific policy code calls out to the xfrm state code to get
those pointers when we could get it in an easier way via the state
itself.

This patch adds an xfrm_state_afinfo to xfrm_mode (since they're
address-specific) and changes the policy code to use it.  I've also
added an owner field to do reference counting on the module providing
the afinfo even though it isn't strictly necessary today since IPv6
can't be unloaded yet.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/xfrm.h
net/ipv4/xfrm4_policy.c
net/ipv4/xfrm4_state.c
net/ipv6/xfrm6_policy.c
net/ipv6/xfrm6_state.c
net/xfrm/xfrm_state.c