mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
xfrm: remove redundant parameter "int dir" in struct xfrm_mgr.acquire
Sematically speaking, xfrm_mgr.acquire is called when kernel intends to ask user space IKE daemon to negotiate SAs with peers. IOW the direction will *always* be XFRM_POLICY_OUT, so remove int dir for clarity. Change-Id: Id4df779e818c5b6f5eccb9bf8250c17eb729f101 Signed-off-by: Fan Du <fan.du@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
adff1877a7
commit
c9f76626c3
3 changed files with 7 additions and 8 deletions
|
@ -582,7 +582,7 @@ struct xfrm_mgr {
|
|||
struct list_head list;
|
||||
char *id;
|
||||
int (*notify)(struct xfrm_state *x, const struct km_event *c);
|
||||
int (*acquire)(struct xfrm_state *x, struct xfrm_tmpl *, struct xfrm_policy *xp, int dir);
|
||||
int (*acquire)(struct xfrm_state *x, struct xfrm_tmpl *, struct xfrm_policy *xp);
|
||||
struct xfrm_policy *(*compile_policy)(struct sock *sk, int opt, u8 *data, int len, int *dir);
|
||||
int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport);
|
||||
int (*notify_policy)(struct xfrm_policy *x, int dir, const struct km_event *c);
|
||||
|
|
|
@ -3055,7 +3055,7 @@ static u32 get_acqseq(void)
|
|||
return res;
|
||||
}
|
||||
|
||||
static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *xp, int dir)
|
||||
static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *xp)
|
||||
{
|
||||
struct sk_buff *skb;
|
||||
struct sadb_msg *hdr;
|
||||
|
@ -3136,7 +3136,7 @@ static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, struct
|
|||
pol->sadb_x_policy_len = sizeof(struct sadb_x_policy)/sizeof(uint64_t);
|
||||
pol->sadb_x_policy_exttype = SADB_X_EXT_POLICY;
|
||||
pol->sadb_x_policy_type = IPSEC_POLICY_IPSEC;
|
||||
pol->sadb_x_policy_dir = dir+1;
|
||||
pol->sadb_x_policy_dir = XFRM_POLICY_OUT + 1;
|
||||
pol->sadb_x_policy_reserved = 0;
|
||||
pol->sadb_x_policy_id = xp->index;
|
||||
pol->sadb_x_policy_priority = xp->priority;
|
||||
|
|
|
@ -2616,8 +2616,7 @@ static inline size_t xfrm_acquire_msgsize(struct xfrm_state *x,
|
|||
}
|
||||
|
||||
static int build_acquire(struct sk_buff *skb, struct xfrm_state *x,
|
||||
struct xfrm_tmpl *xt, struct xfrm_policy *xp,
|
||||
int dir)
|
||||
struct xfrm_tmpl *xt, struct xfrm_policy *xp)
|
||||
{
|
||||
__u32 seq = xfrm_get_acqseq();
|
||||
struct xfrm_user_acquire *ua;
|
||||
|
@ -2632,7 +2631,7 @@ static int build_acquire(struct sk_buff *skb, struct xfrm_state *x,
|
|||
memcpy(&ua->id, &x->id, sizeof(ua->id));
|
||||
memcpy(&ua->saddr, &x->props.saddr, sizeof(ua->saddr));
|
||||
memcpy(&ua->sel, &x->sel, sizeof(ua->sel));
|
||||
copy_to_user_policy(xp, &ua->policy, dir);
|
||||
copy_to_user_policy(xp, &ua->policy, XFRM_POLICY_OUT);
|
||||
ua->aalgos = xt->aalgos;
|
||||
ua->ealgos = xt->ealgos;
|
||||
ua->calgos = xt->calgos;
|
||||
|
@ -2654,7 +2653,7 @@ static int build_acquire(struct sk_buff *skb, struct xfrm_state *x,
|
|||
}
|
||||
|
||||
static int xfrm_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *xt,
|
||||
struct xfrm_policy *xp, int dir)
|
||||
struct xfrm_policy *xp)
|
||||
{
|
||||
struct net *net = xs_net(x);
|
||||
struct sk_buff *skb;
|
||||
|
@ -2663,7 +2662,7 @@ static int xfrm_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *xt,
|
|||
if (skb == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
if (build_acquire(skb, x, xt, xp, dir) < 0)
|
||||
if (build_acquire(skb, x, xt, xp) < 0)
|
||||
BUG();
|
||||
|
||||
return nlmsg_multicast(net->xfrm.nlsk, skb, 0, XFRMNLGRP_ACQUIRE, GFP_ATOMIC);
|
||||
|
|
Loading…
Reference in a new issue