diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-01-09 11:05:12 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-01-09 11:05:12 -0500 |
commit | fd0b45dfd1858c6b49d06355a460bcf36d654c06 (patch) | |
tree | 85386a76355b398b7f452b737af4ab48f116677a /net/xfrm/xfrm_user.c | |
parent | fcfd50afb6e94c8cf121ca4e7e3e7166bae7c6aa (diff) | |
parent | 1c9b7aa1eb40ab708ef3242f74b9a61487623168 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (36 commits)
[ATM]: Check IP header validity in mpc_send_packet
[IPV6]: IPV6_MULTICAST_IF setting is ignored on link-local connect()
[CONNECTOR]: Don't touch queue dev after decrement of ref count.
[SOCK]: Adds a rcu_dereference() in sk_filter
[XFRM]: xfrm_algo_clone() allocates too much memory
[FORCEDETH]: Fix reversing the MAC address on suspend.
[NET]: mcs7830 passes msecs instead of jiffies to usb_control_msg
[LRO] Fix lro_mgr->features checks
[NET]: Clone the sk_buff 'iif' field in __skb_clone()
[IPV4] ROUTE: ip_rt_dump() is unecessary slow
[NET]: kaweth was forgotten in msec switchover of usb_start_wait_urb
[NET] Intel ethernet drivers: update MAINTAINERS
[NET]: Make ->poll() breakout consistent in Intel ethernet drivers.
[NET]: Stop polling when napi_disable() is pending.
[NET]: Fix drivers to handle napi_disable() disabling interrupts.
[NETXEN]: Fix ->poll() done logic.
mac80211: return an error when SIWRATE doesn't match any rate
ssb: Fix probing of PCI cores if PCI and PCIE core is available
[NET]: Do not check netif_running() and carrier state in ->poll()
[NET]: Add NAPI_STATE_DISABLE.
...
Diffstat (limited to 'net/xfrm/xfrm_user.c')
-rw-r--r-- | net/xfrm/xfrm_user.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index e75dbdcb08a4..c4f6419b1769 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -31,11 +31,6 @@ | |||
31 | #include <linux/in6.h> | 31 | #include <linux/in6.h> |
32 | #endif | 32 | #endif |
33 | 33 | ||
34 | static inline int alg_len(struct xfrm_algo *alg) | ||
35 | { | ||
36 | return sizeof(*alg) + ((alg->alg_key_len + 7) / 8); | ||
37 | } | ||
38 | |||
39 | static int verify_one_alg(struct nlattr **attrs, enum xfrm_attr_type_t type) | 34 | static int verify_one_alg(struct nlattr **attrs, enum xfrm_attr_type_t type) |
40 | { | 35 | { |
41 | struct nlattr *rt = attrs[type]; | 36 | struct nlattr *rt = attrs[type]; |
@@ -45,7 +40,7 @@ static int verify_one_alg(struct nlattr **attrs, enum xfrm_attr_type_t type) | |||
45 | return 0; | 40 | return 0; |
46 | 41 | ||
47 | algp = nla_data(rt); | 42 | algp = nla_data(rt); |
48 | if (nla_len(rt) < alg_len(algp)) | 43 | if (nla_len(rt) < xfrm_alg_len(algp)) |
49 | return -EINVAL; | 44 | return -EINVAL; |
50 | 45 | ||
51 | switch (type) { | 46 | switch (type) { |
@@ -204,7 +199,7 @@ static int attach_one_algo(struct xfrm_algo **algpp, u8 *props, | |||
204 | return -ENOSYS; | 199 | return -ENOSYS; |
205 | *props = algo->desc.sadb_alg_id; | 200 | *props = algo->desc.sadb_alg_id; |
206 | 201 | ||
207 | p = kmemdup(ualg, alg_len(ualg), GFP_KERNEL); | 202 | p = kmemdup(ualg, xfrm_alg_len(ualg), GFP_KERNEL); |
208 | if (!p) | 203 | if (!p) |
209 | return -ENOMEM; | 204 | return -ENOMEM; |
210 | 205 | ||
@@ -516,9 +511,9 @@ static int copy_to_user_state_extra(struct xfrm_state *x, | |||
516 | NLA_PUT_U64(skb, XFRMA_LASTUSED, x->lastused); | 511 | NLA_PUT_U64(skb, XFRMA_LASTUSED, x->lastused); |
517 | 512 | ||
518 | if (x->aalg) | 513 | if (x->aalg) |
519 | NLA_PUT(skb, XFRMA_ALG_AUTH, alg_len(x->aalg), x->aalg); | 514 | NLA_PUT(skb, XFRMA_ALG_AUTH, xfrm_alg_len(x->aalg), x->aalg); |
520 | if (x->ealg) | 515 | if (x->ealg) |
521 | NLA_PUT(skb, XFRMA_ALG_CRYPT, alg_len(x->ealg), x->ealg); | 516 | NLA_PUT(skb, XFRMA_ALG_CRYPT, xfrm_alg_len(x->ealg), x->ealg); |
522 | if (x->calg) | 517 | if (x->calg) |
523 | NLA_PUT(skb, XFRMA_ALG_COMP, sizeof(*(x->calg)), x->calg); | 518 | NLA_PUT(skb, XFRMA_ALG_COMP, sizeof(*(x->calg)), x->calg); |
524 | 519 | ||
@@ -1978,9 +1973,9 @@ static inline size_t xfrm_sa_len(struct xfrm_state *x) | |||
1978 | { | 1973 | { |
1979 | size_t l = 0; | 1974 | size_t l = 0; |
1980 | if (x->aalg) | 1975 | if (x->aalg) |
1981 | l += nla_total_size(alg_len(x->aalg)); | 1976 | l += nla_total_size(xfrm_alg_len(x->aalg)); |
1982 | if (x->ealg) | 1977 | if (x->ealg) |
1983 | l += nla_total_size(alg_len(x->ealg)); | 1978 | l += nla_total_size(xfrm_alg_len(x->ealg)); |
1984 | if (x->calg) | 1979 | if (x->calg) |
1985 | l += nla_total_size(sizeof(*x->calg)); | 1980 | l += nla_total_size(sizeof(*x->calg)); |
1986 | if (x->encap) | 1981 | if (x->encap) |