diff options
author | David S. Miller <davem@davemloft.net> | 2011-02-24 00:02:38 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-02-24 02:07:37 -0500 |
commit | 214e005bc32c7045b8554f9f0fb07b3fcce2cd42 (patch) | |
tree | 19549e83718646b6ec942f9c4aaf8ce5645cb0d0 | |
parent | 55ae22d08fc9b531bc8a88b7306004e7053bb425 (diff) |
xfrm: Pass km_event pointers around as const when possible.
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/xfrm.h | 8 | ||||
-rw-r--r-- | net/key/af_key.c | 16 | ||||
-rw-r--r-- | net/xfrm/xfrm_state.c | 4 | ||||
-rw-r--r-- | net/xfrm/xfrm_user.c | 24 |
4 files changed, 26 insertions, 26 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index bb824a5d71bf..6ef5c374ef8a 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -284,8 +284,8 @@ struct xfrm_policy_afinfo { | |||
284 | 284 | ||
285 | extern int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo); | 285 | extern int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo); |
286 | extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo); | 286 | extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo); |
287 | extern void km_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c); | 287 | extern void km_policy_notify(struct xfrm_policy *xp, int dir, const struct km_event *c); |
288 | extern void km_state_notify(struct xfrm_state *x, struct km_event *c); | 288 | extern void km_state_notify(struct xfrm_state *x, const struct km_event *c); |
289 | 289 | ||
290 | struct xfrm_tmpl; | 290 | struct xfrm_tmpl; |
291 | extern int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol); | 291 | extern int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol); |
@@ -548,11 +548,11 @@ struct xfrm_migrate { | |||
548 | struct xfrm_mgr { | 548 | struct xfrm_mgr { |
549 | struct list_head list; | 549 | struct list_head list; |
550 | char *id; | 550 | char *id; |
551 | int (*notify)(struct xfrm_state *x, struct km_event *c); | 551 | int (*notify)(struct xfrm_state *x, const struct km_event *c); |
552 | int (*acquire)(struct xfrm_state *x, struct xfrm_tmpl *, struct xfrm_policy *xp, int dir); | 552 | int (*acquire)(struct xfrm_state *x, struct xfrm_tmpl *, struct xfrm_policy *xp, int dir); |
553 | struct xfrm_policy *(*compile_policy)(struct sock *sk, int opt, u8 *data, int len, int *dir); | 553 | struct xfrm_policy *(*compile_policy)(struct sock *sk, int opt, u8 *data, int len, int *dir); |
554 | int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); | 554 | int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); |
555 | int (*notify_policy)(struct xfrm_policy *x, int dir, struct km_event *c); | 555 | int (*notify_policy)(struct xfrm_policy *x, int dir, const struct km_event *c); |
556 | int (*report)(struct net *net, u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr); | 556 | int (*report)(struct net *net, u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr); |
557 | int (*migrate)(struct xfrm_selector *sel, u8 dir, u8 type, struct xfrm_migrate *m, int num_bundles, struct xfrm_kmaddress *k); | 557 | int (*migrate)(struct xfrm_selector *sel, u8 dir, u8 type, struct xfrm_migrate *m, int num_bundles, struct xfrm_kmaddress *k); |
558 | }; | 558 | }; |
diff --git a/net/key/af_key.c b/net/key/af_key.c index 60fd2f13f427..7c5e101e7c28 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
@@ -1429,7 +1429,7 @@ static inline int event2keytype(int event) | |||
1429 | } | 1429 | } |
1430 | 1430 | ||
1431 | /* ADD/UPD/DEL */ | 1431 | /* ADD/UPD/DEL */ |
1432 | static int key_notify_sa(struct xfrm_state *x, struct km_event *c) | 1432 | static int key_notify_sa(struct xfrm_state *x, const struct km_event *c) |
1433 | { | 1433 | { |
1434 | struct sk_buff *skb; | 1434 | struct sk_buff *skb; |
1435 | struct sadb_msg *hdr; | 1435 | struct sadb_msg *hdr; |
@@ -1688,7 +1688,7 @@ static int unicast_flush_resp(struct sock *sk, struct sadb_msg *ihdr) | |||
1688 | return pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ONE, sk, sock_net(sk)); | 1688 | return pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ONE, sk, sock_net(sk)); |
1689 | } | 1689 | } |
1690 | 1690 | ||
1691 | static int key_notify_sa_flush(struct km_event *c) | 1691 | static int key_notify_sa_flush(const struct km_event *c) |
1692 | { | 1692 | { |
1693 | struct sk_buff *skb; | 1693 | struct sk_buff *skb; |
1694 | struct sadb_msg *hdr; | 1694 | struct sadb_msg *hdr; |
@@ -2123,7 +2123,7 @@ static int pfkey_xfrm_policy2msg(struct sk_buff *skb, struct xfrm_policy *xp, in | |||
2123 | return 0; | 2123 | return 0; |
2124 | } | 2124 | } |
2125 | 2125 | ||
2126 | static int key_notify_policy(struct xfrm_policy *xp, int dir, struct km_event *c) | 2126 | static int key_notify_policy(struct xfrm_policy *xp, int dir, const struct km_event *c) |
2127 | { | 2127 | { |
2128 | struct sk_buff *out_skb; | 2128 | struct sk_buff *out_skb; |
2129 | struct sadb_msg *out_hdr; | 2129 | struct sadb_msg *out_hdr; |
@@ -2660,7 +2660,7 @@ static int pfkey_spddump(struct sock *sk, struct sk_buff *skb, struct sadb_msg * | |||
2660 | return pfkey_do_dump(pfk); | 2660 | return pfkey_do_dump(pfk); |
2661 | } | 2661 | } |
2662 | 2662 | ||
2663 | static int key_notify_policy_flush(struct km_event *c) | 2663 | static int key_notify_policy_flush(const struct km_event *c) |
2664 | { | 2664 | { |
2665 | struct sk_buff *skb_out; | 2665 | struct sk_buff *skb_out; |
2666 | struct sadb_msg *hdr; | 2666 | struct sadb_msg *hdr; |
@@ -2914,12 +2914,12 @@ static void dump_esp_combs(struct sk_buff *skb, struct xfrm_tmpl *t) | |||
2914 | } | 2914 | } |
2915 | } | 2915 | } |
2916 | 2916 | ||
2917 | static int key_notify_policy_expire(struct xfrm_policy *xp, struct km_event *c) | 2917 | static int key_notify_policy_expire(struct xfrm_policy *xp, const struct km_event *c) |
2918 | { | 2918 | { |
2919 | return 0; | 2919 | return 0; |
2920 | } | 2920 | } |
2921 | 2921 | ||
2922 | static int key_notify_sa_expire(struct xfrm_state *x, struct km_event *c) | 2922 | static int key_notify_sa_expire(struct xfrm_state *x, const struct km_event *c) |
2923 | { | 2923 | { |
2924 | struct sk_buff *out_skb; | 2924 | struct sk_buff *out_skb; |
2925 | struct sadb_msg *out_hdr; | 2925 | struct sadb_msg *out_hdr; |
@@ -2949,7 +2949,7 @@ static int key_notify_sa_expire(struct xfrm_state *x, struct km_event *c) | |||
2949 | return 0; | 2949 | return 0; |
2950 | } | 2950 | } |
2951 | 2951 | ||
2952 | static int pfkey_send_notify(struct xfrm_state *x, struct km_event *c) | 2952 | static int pfkey_send_notify(struct xfrm_state *x, const struct km_event *c) |
2953 | { | 2953 | { |
2954 | struct net *net = x ? xs_net(x) : c->net; | 2954 | struct net *net = x ? xs_net(x) : c->net; |
2955 | struct netns_pfkey *net_pfkey = net_generic(net, pfkey_net_id); | 2955 | struct netns_pfkey *net_pfkey = net_generic(net, pfkey_net_id); |
@@ -2976,7 +2976,7 @@ static int pfkey_send_notify(struct xfrm_state *x, struct km_event *c) | |||
2976 | return 0; | 2976 | return 0; |
2977 | } | 2977 | } |
2978 | 2978 | ||
2979 | static int pfkey_send_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c) | 2979 | static int pfkey_send_policy_notify(struct xfrm_policy *xp, int dir, const struct km_event *c) |
2980 | { | 2980 | { |
2981 | if (xp && xp->type != XFRM_POLICY_TYPE_MAIN) | 2981 | if (xp && xp->type != XFRM_POLICY_TYPE_MAIN) |
2982 | return 0; | 2982 | return 0; |
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 30a0f178819c..7028f063f093 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -1727,7 +1727,7 @@ void xfrm_replay_advance(struct xfrm_state *x, __be32 net_seq) | |||
1727 | static LIST_HEAD(xfrm_km_list); | 1727 | static LIST_HEAD(xfrm_km_list); |
1728 | static DEFINE_RWLOCK(xfrm_km_lock); | 1728 | static DEFINE_RWLOCK(xfrm_km_lock); |
1729 | 1729 | ||
1730 | void km_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c) | 1730 | void km_policy_notify(struct xfrm_policy *xp, int dir, const struct km_event *c) |
1731 | { | 1731 | { |
1732 | struct xfrm_mgr *km; | 1732 | struct xfrm_mgr *km; |
1733 | 1733 | ||
@@ -1738,7 +1738,7 @@ void km_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c) | |||
1738 | read_unlock(&xfrm_km_lock); | 1738 | read_unlock(&xfrm_km_lock); |
1739 | } | 1739 | } |
1740 | 1740 | ||
1741 | void km_state_notify(struct xfrm_state *x, struct km_event *c) | 1741 | void km_state_notify(struct xfrm_state *x, const struct km_event *c) |
1742 | { | 1742 | { |
1743 | struct xfrm_mgr *km; | 1743 | struct xfrm_mgr *km; |
1744 | read_lock(&xfrm_km_lock); | 1744 | read_lock(&xfrm_km_lock); |
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 61291965c5f6..2cc9dab29887 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -1582,7 +1582,7 @@ static inline size_t xfrm_aevent_msgsize(void) | |||
1582 | + nla_total_size(4); /* XFRM_AE_ETHR */ | 1582 | + nla_total_size(4); /* XFRM_AE_ETHR */ |
1583 | } | 1583 | } |
1584 | 1584 | ||
1585 | static int build_aevent(struct sk_buff *skb, struct xfrm_state *x, struct km_event *c) | 1585 | static int build_aevent(struct sk_buff *skb, struct xfrm_state *x, const struct km_event *c) |
1586 | { | 1586 | { |
1587 | struct xfrm_aevent_id *id; | 1587 | struct xfrm_aevent_id *id; |
1588 | struct nlmsghdr *nlh; | 1588 | struct nlmsghdr *nlh; |
@@ -2220,7 +2220,7 @@ static inline size_t xfrm_expire_msgsize(void) | |||
2220 | + nla_total_size(sizeof(struct xfrm_mark)); | 2220 | + nla_total_size(sizeof(struct xfrm_mark)); |
2221 | } | 2221 | } |
2222 | 2222 | ||
2223 | static int build_expire(struct sk_buff *skb, struct xfrm_state *x, struct km_event *c) | 2223 | static int build_expire(struct sk_buff *skb, struct xfrm_state *x, const struct km_event *c) |
2224 | { | 2224 | { |
2225 | struct xfrm_user_expire *ue; | 2225 | struct xfrm_user_expire *ue; |
2226 | struct nlmsghdr *nlh; | 2226 | struct nlmsghdr *nlh; |
@@ -2242,7 +2242,7 @@ nla_put_failure: | |||
2242 | return -EMSGSIZE; | 2242 | return -EMSGSIZE; |
2243 | } | 2243 | } |
2244 | 2244 | ||
2245 | static int xfrm_exp_state_notify(struct xfrm_state *x, struct km_event *c) | 2245 | static int xfrm_exp_state_notify(struct xfrm_state *x, const struct km_event *c) |
2246 | { | 2246 | { |
2247 | struct net *net = xs_net(x); | 2247 | struct net *net = xs_net(x); |
2248 | struct sk_buff *skb; | 2248 | struct sk_buff *skb; |
@@ -2259,7 +2259,7 @@ static int xfrm_exp_state_notify(struct xfrm_state *x, struct km_event *c) | |||
2259 | return nlmsg_multicast(net->xfrm.nlsk, skb, 0, XFRMNLGRP_EXPIRE, GFP_ATOMIC); | 2259 | return nlmsg_multicast(net->xfrm.nlsk, skb, 0, XFRMNLGRP_EXPIRE, GFP_ATOMIC); |
2260 | } | 2260 | } |
2261 | 2261 | ||
2262 | static int xfrm_aevent_state_notify(struct xfrm_state *x, struct km_event *c) | 2262 | static int xfrm_aevent_state_notify(struct xfrm_state *x, const struct km_event *c) |
2263 | { | 2263 | { |
2264 | struct net *net = xs_net(x); | 2264 | struct net *net = xs_net(x); |
2265 | struct sk_buff *skb; | 2265 | struct sk_buff *skb; |
@@ -2274,7 +2274,7 @@ static int xfrm_aevent_state_notify(struct xfrm_state *x, struct km_event *c) | |||
2274 | return nlmsg_multicast(net->xfrm.nlsk, skb, 0, XFRMNLGRP_AEVENTS, GFP_ATOMIC); | 2274 | return nlmsg_multicast(net->xfrm.nlsk, skb, 0, XFRMNLGRP_AEVENTS, GFP_ATOMIC); |
2275 | } | 2275 | } |
2276 | 2276 | ||
2277 | static int xfrm_notify_sa_flush(struct km_event *c) | 2277 | static int xfrm_notify_sa_flush(const struct km_event *c) |
2278 | { | 2278 | { |
2279 | struct net *net = c->net; | 2279 | struct net *net = c->net; |
2280 | struct xfrm_usersa_flush *p; | 2280 | struct xfrm_usersa_flush *p; |
@@ -2330,7 +2330,7 @@ static inline size_t xfrm_sa_len(struct xfrm_state *x) | |||
2330 | return l; | 2330 | return l; |
2331 | } | 2331 | } |
2332 | 2332 | ||
2333 | static int xfrm_notify_sa(struct xfrm_state *x, struct km_event *c) | 2333 | static int xfrm_notify_sa(struct xfrm_state *x, const struct km_event *c) |
2334 | { | 2334 | { |
2335 | struct net *net = xs_net(x); | 2335 | struct net *net = xs_net(x); |
2336 | struct xfrm_usersa_info *p; | 2336 | struct xfrm_usersa_info *p; |
@@ -2387,7 +2387,7 @@ nla_put_failure: | |||
2387 | return -1; | 2387 | return -1; |
2388 | } | 2388 | } |
2389 | 2389 | ||
2390 | static int xfrm_send_state_notify(struct xfrm_state *x, struct km_event *c) | 2390 | static int xfrm_send_state_notify(struct xfrm_state *x, const struct km_event *c) |
2391 | { | 2391 | { |
2392 | 2392 | ||
2393 | switch (c->event) { | 2393 | switch (c->event) { |
@@ -2546,7 +2546,7 @@ static inline size_t xfrm_polexpire_msgsize(struct xfrm_policy *xp) | |||
2546 | } | 2546 | } |
2547 | 2547 | ||
2548 | static int build_polexpire(struct sk_buff *skb, struct xfrm_policy *xp, | 2548 | static int build_polexpire(struct sk_buff *skb, struct xfrm_policy *xp, |
2549 | int dir, struct km_event *c) | 2549 | int dir, const struct km_event *c) |
2550 | { | 2550 | { |
2551 | struct xfrm_user_polexpire *upe; | 2551 | struct xfrm_user_polexpire *upe; |
2552 | struct nlmsghdr *nlh; | 2552 | struct nlmsghdr *nlh; |
@@ -2576,7 +2576,7 @@ nlmsg_failure: | |||
2576 | return -EMSGSIZE; | 2576 | return -EMSGSIZE; |
2577 | } | 2577 | } |
2578 | 2578 | ||
2579 | static int xfrm_exp_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c) | 2579 | static int xfrm_exp_policy_notify(struct xfrm_policy *xp, int dir, const struct km_event *c) |
2580 | { | 2580 | { |
2581 | struct net *net = xp_net(xp); | 2581 | struct net *net = xp_net(xp); |
2582 | struct sk_buff *skb; | 2582 | struct sk_buff *skb; |
@@ -2591,7 +2591,7 @@ static int xfrm_exp_policy_notify(struct xfrm_policy *xp, int dir, struct km_eve | |||
2591 | return nlmsg_multicast(net->xfrm.nlsk, skb, 0, XFRMNLGRP_EXPIRE, GFP_ATOMIC); | 2591 | return nlmsg_multicast(net->xfrm.nlsk, skb, 0, XFRMNLGRP_EXPIRE, GFP_ATOMIC); |
2592 | } | 2592 | } |
2593 | 2593 | ||
2594 | static int xfrm_notify_policy(struct xfrm_policy *xp, int dir, struct km_event *c) | 2594 | static int xfrm_notify_policy(struct xfrm_policy *xp, int dir, const struct km_event *c) |
2595 | { | 2595 | { |
2596 | struct net *net = xp_net(xp); | 2596 | struct net *net = xp_net(xp); |
2597 | struct xfrm_userpolicy_info *p; | 2597 | struct xfrm_userpolicy_info *p; |
@@ -2656,7 +2656,7 @@ nlmsg_failure: | |||
2656 | return -1; | 2656 | return -1; |
2657 | } | 2657 | } |
2658 | 2658 | ||
2659 | static int xfrm_notify_policy_flush(struct km_event *c) | 2659 | static int xfrm_notify_policy_flush(const struct km_event *c) |
2660 | { | 2660 | { |
2661 | struct net *net = c->net; | 2661 | struct net *net = c->net; |
2662 | struct nlmsghdr *nlh; | 2662 | struct nlmsghdr *nlh; |
@@ -2681,7 +2681,7 @@ nlmsg_failure: | |||
2681 | return -1; | 2681 | return -1; |
2682 | } | 2682 | } |
2683 | 2683 | ||
2684 | static int xfrm_send_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c) | 2684 | static int xfrm_send_policy_notify(struct xfrm_policy *xp, int dir, const struct km_event *c) |
2685 | { | 2685 | { |
2686 | 2686 | ||
2687 | switch (c->event) { | 2687 | switch (c->event) { |