aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorJamal Hadi Salim <hadi@cyberus.ca>2006-08-31 20:42:59 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 18:18:48 -0400
commiteb878e84575fbce21d2edb079eada78bfa27023d (patch)
treef47eb18d4539015596de96ccb9ac3fd20584cbe5 /net/ipv4
parentfda9ef5d679b07c9d9097aaf6ef7f069d794a8f9 (diff)
[IPSEC]: output mode to take an xfrm state as input param
Expose IPSEC modes output path to take an xfrm state as input param. This makes it consistent with the input mode processing (which already takes the xfrm state as a param). Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/xfrm4_mode_transport.c4
-rw-r--r--net/ipv4/xfrm4_mode_tunnel.c3
-rw-r--r--net/ipv4/xfrm4_output.c2
3 files changed, 3 insertions, 6 deletions
diff --git a/net/ipv4/xfrm4_mode_transport.c b/net/ipv4/xfrm4_mode_transport.c
index a9e6b3dd19c9..92676b7e4034 100644
--- a/net/ipv4/xfrm4_mode_transport.c
+++ b/net/ipv4/xfrm4_mode_transport.c
@@ -21,9 +21,8 @@
21 * On exit, skb->h will be set to the start of the payload to be processed 21 * On exit, skb->h will be set to the start of the payload to be processed
22 * by x->type->output and skb->nh will be set to the top IP header. 22 * by x->type->output and skb->nh will be set to the top IP header.
23 */ 23 */
24static int xfrm4_transport_output(struct sk_buff *skb) 24static int xfrm4_transport_output(struct xfrm_state *x, struct sk_buff *skb)
25{ 25{
26 struct xfrm_state *x;
27 struct iphdr *iph; 26 struct iphdr *iph;
28 int ihl; 27 int ihl;
29 28
@@ -33,7 +32,6 @@ static int xfrm4_transport_output(struct sk_buff *skb)
33 ihl = iph->ihl * 4; 32 ihl = iph->ihl * 4;
34 skb->h.raw += ihl; 33 skb->h.raw += ihl;
35 34
36 x = skb->dst->xfrm;
37 skb->nh.raw = memmove(skb_push(skb, x->props.header_len), iph, ihl); 35 skb->nh.raw = memmove(skb_push(skb, x->props.header_len), iph, ihl);
38 return 0; 36 return 0;
39} 37}
diff --git a/net/ipv4/xfrm4_mode_tunnel.c b/net/ipv4/xfrm4_mode_tunnel.c
index 13cafbe56ce3..e23c21d31a53 100644
--- a/net/ipv4/xfrm4_mode_tunnel.c
+++ b/net/ipv4/xfrm4_mode_tunnel.c
@@ -33,10 +33,9 @@ static inline void ipip_ecn_decapsulate(struct sk_buff *skb)
33 * On exit, skb->h will be set to the start of the payload to be processed 33 * On exit, skb->h will be set to the start of the payload to be processed
34 * by x->type->output and skb->nh will be set to the top IP header. 34 * by x->type->output and skb->nh will be set to the top IP header.
35 */ 35 */
36static int xfrm4_tunnel_output(struct sk_buff *skb) 36static int xfrm4_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
37{ 37{
38 struct dst_entry *dst = skb->dst; 38 struct dst_entry *dst = skb->dst;
39 struct xfrm_state *x = dst->xfrm;
40 struct iphdr *iph, *top_iph; 39 struct iphdr *iph, *top_iph;
41 int flags; 40 int flags;
42 41
diff --git a/net/ipv4/xfrm4_output.c b/net/ipv4/xfrm4_output.c
index 5fd115f0c547..04403fb01a58 100644
--- a/net/ipv4/xfrm4_output.c
+++ b/net/ipv4/xfrm4_output.c
@@ -66,7 +66,7 @@ static int xfrm4_output_one(struct sk_buff *skb)
66 if (err) 66 if (err)
67 goto error; 67 goto error;
68 68
69 err = x->mode->output(skb); 69 err = x->mode->output(x, skb);
70 if (err) 70 if (err)
71 goto error; 71 goto error;
72 72