aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm
diff options
context:
space:
mode:
authorFan Du <fan.du@windriver.com>2012-08-14 22:13:47 -0400
committerDavid S. Miller <davem@davemloft.net>2012-08-15 18:13:30 -0400
commit65e0736bc2ac314bd374e93c24dd0698ac5ee66d (patch)
tree2cf89c8388186fe15ffb144e07d323fc216aa9f1 /net/xfrm
parent1f07b62f3205f6ed41759df2892eaf433bc051a1 (diff)
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. Signed-off-by: Fan Du <fan.du@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm')
-rw-r--r--net/xfrm/xfrm_state.c2
-rw-r--r--net/xfrm/xfrm_user.c9
2 files changed, 5 insertions, 6 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 87cd0e4d4282..7856c33898fa 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -1700,7 +1700,7 @@ int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol)
1700 1700
1701 read_lock(&xfrm_km_lock); 1701 read_lock(&xfrm_km_lock);
1702 list_for_each_entry(km, &xfrm_km_list, list) { 1702 list_for_each_entry(km, &xfrm_km_list, list) {
1703 acqret = km->acquire(x, t, pol, XFRM_POLICY_OUT); 1703 acqret = km->acquire(x, t, pol);
1704 if (!acqret) 1704 if (!acqret)
1705 err = acqret; 1705 err = acqret;
1706 } 1706 }
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index e75d8e47f35c..ab58034c42d6 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -2567,8 +2567,7 @@ static inline size_t xfrm_acquire_msgsize(struct xfrm_state *x,
2567} 2567}
2568 2568
2569static int build_acquire(struct sk_buff *skb, struct xfrm_state *x, 2569static int build_acquire(struct sk_buff *skb, struct xfrm_state *x,
2570 struct xfrm_tmpl *xt, struct xfrm_policy *xp, 2570 struct xfrm_tmpl *xt, struct xfrm_policy *xp)
2571 int dir)
2572{ 2571{
2573 __u32 seq = xfrm_get_acqseq(); 2572 __u32 seq = xfrm_get_acqseq();
2574 struct xfrm_user_acquire *ua; 2573 struct xfrm_user_acquire *ua;
@@ -2583,7 +2582,7 @@ static int build_acquire(struct sk_buff *skb, struct xfrm_state *x,
2583 memcpy(&ua->id, &x->id, sizeof(ua->id)); 2582 memcpy(&ua->id, &x->id, sizeof(ua->id));
2584 memcpy(&ua->saddr, &x->props.saddr, sizeof(ua->saddr)); 2583 memcpy(&ua->saddr, &x->props.saddr, sizeof(ua->saddr));
2585 memcpy(&ua->sel, &x->sel, sizeof(ua->sel)); 2584 memcpy(&ua->sel, &x->sel, sizeof(ua->sel));
2586 copy_to_user_policy(xp, &ua->policy, dir); 2585 copy_to_user_policy(xp, &ua->policy, XFRM_POLICY_OUT);
2587 ua->aalgos = xt->aalgos; 2586 ua->aalgos = xt->aalgos;
2588 ua->ealgos = xt->ealgos; 2587 ua->ealgos = xt->ealgos;
2589 ua->calgos = xt->calgos; 2588 ua->calgos = xt->calgos;
@@ -2605,7 +2604,7 @@ static int build_acquire(struct sk_buff *skb, struct xfrm_state *x,
2605} 2604}
2606 2605
2607static int xfrm_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *xt, 2606static int xfrm_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *xt,
2608 struct xfrm_policy *xp, int dir) 2607 struct xfrm_policy *xp)
2609{ 2608{
2610 struct net *net = xs_net(x); 2609 struct net *net = xs_net(x);
2611 struct sk_buff *skb; 2610 struct sk_buff *skb;
@@ -2614,7 +2613,7 @@ static int xfrm_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *xt,
2614 if (skb == NULL) 2613 if (skb == NULL)
2615 return -ENOMEM; 2614 return -ENOMEM;
2616 2615
2617 if (build_acquire(skb, x, xt, xp, dir) < 0) 2616 if (build_acquire(skb, x, xt, xp) < 0)
2618 BUG(); 2617 BUG();
2619 2618
2620 return nlmsg_multicast(net->xfrm.nlsk, skb, 0, XFRMNLGRP_ACQUIRE, GFP_ATOMIC); 2619 return nlmsg_multicast(net->xfrm.nlsk, skb, 0, XFRMNLGRP_ACQUIRE, GFP_ATOMIC);