xfrm: Remove meaningling function parameters

It makes no sense to pass net or sk into xfrm_output as they
don't get passed into xfrm_output_resume where all of the
actual work happens.

If a paramater is not derivable from dst->xfrm it effectively
does not exist in the xfrm layer.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 2068020..a3bde1b 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1507,7 +1507,7 @@
 int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type);
 int xfrm_input_resume(struct sk_buff *skb, int nexthdr);
 int xfrm_output_resume(struct sk_buff *skb, int err);
-int xfrm_output(struct net *net, struct sock *sk, struct sk_buff *skb);
+int xfrm_output(struct sk_buff *skb);
 int xfrm_inner_extract_output(struct xfrm_state *x, struct sk_buff *skb);
 void xfrm_local_error(struct sk_buff *skb, int mtu);
 int xfrm4_extract_header(struct sk_buff *skb);
diff --git a/net/ipv4/xfrm4_output.c b/net/ipv4/xfrm4_output.c
index 5ba782d..b466773 100644
--- a/net/ipv4/xfrm4_output.c
+++ b/net/ipv4/xfrm4_output.c
@@ -77,7 +77,7 @@
 	IPCB(skb)->flags |= IPSKB_XFRM_TRANSFORMED;
 #endif
 
-	return xfrm_output(net, sk, skb);
+	return xfrm_output(skb);
 }
 
 static int __xfrm4_output(struct net *net, struct sock *sk, struct sk_buff *skb)
diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c
index a3286cb..8ef7be3 100644
--- a/net/ipv6/xfrm6_output.c
+++ b/net/ipv6/xfrm6_output.c
@@ -128,7 +128,7 @@
 	IP6CB(skb)->flags |= IP6SKB_XFRM_TRANSFORMED;
 #endif
 
-	return xfrm_output(net, sk, skb);
+	return xfrm_output(skb);
 }
 
 static int __xfrm6_output(struct net *net, struct sock *sk, struct sk_buff *skb)
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index 7392bf1..3d13952 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -163,7 +163,7 @@
 	return xfrm_output_resume(skb, 1);
 }
 
-static int xfrm_output_gso(struct net *net, struct sock *sk, struct sk_buff *skb)
+static int xfrm_output_gso(struct net *net, struct sk_buff *skb)
 {
 	struct sk_buff *segs;
 
@@ -179,7 +179,7 @@
 		int err;
 
 		segs->next = NULL;
-		err = xfrm_output2(net, sk, segs);
+		err = xfrm_output2(net, NULL, segs);
 
 		if (unlikely(err)) {
 			kfree_skb_list(nskb);
@@ -192,12 +192,13 @@
 	return 0;
 }
 
-int xfrm_output(struct net *net, struct sock *sk, struct sk_buff *skb)
+int xfrm_output(struct sk_buff *skb)
 {
+	struct net *net = xs_net(skb_dst(skb)->xfrm);
 	int err;
 
 	if (skb_is_gso(skb))
-		return xfrm_output_gso(net, sk, skb);
+		return xfrm_output_gso(net, skb);
 
 	if (skb->ip_summed == CHECKSUM_PARTIAL) {
 		err = skb_checksum_help(skb);
@@ -208,7 +209,7 @@
 		}
 	}
 
-	return xfrm_output2(net, sk, skb);
+	return xfrm_output2(net, NULL, skb);
 }
 EXPORT_SYMBOL_GPL(xfrm_output);