summaryrefslogtreecommitdiffstats
path: root/net/key/af_key.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2007-10-09 22:30:57 +0200
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-11 01:55:02 +0200
commit68325d3b12ad5bce650c2883bb878257f197efff (patch)
treec6d15e03e017599b07742d0a8453e4ee8ee253e3 /net/key/af_key.c
parent[IPSEC]: Move common code into xfrm_alloc_spi (diff)
downloadlinux-68325d3b12ad5bce650c2883bb878257f197efff.tar.xz
linux-68325d3b12ad5bce650c2883bb878257f197efff.zip
[XFRM] user: Move attribute copying code into copy_to_user_state_extra
Here's a good example of code duplication leading to code rot. The notification patch did its own netlink message creation for xfrm states. It duplicated code that was already in dump_one_state. Guess what, the next time (and the time after) when someone updated dump_one_state the notification path got zilch. This patch moves that code from dump_one_state to copy_to_user_state_extra and uses it in xfrm_notify_sa too. Unfortunately whoever updates this still needs to update xfrm_sa_len since the notification path wants to know the exact size for allocation. At least I've added a comment saying so and if someone still forgest, we'll have a WARN_ON telling us so. I also changed the security size calculation to use xfrm_user_sec_ctx since that's what we actually put into the skb. However it makes no practical difference since it has the same size as xfrm_sec_ctx. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/key/af_key.c')
0 files changed, 0 insertions, 0 deletions