]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/xfrm4_tunnel.c
x86: unification of cfufreq/Kconfig
[linux-2.6-omap-h63xx.git] / net / ipv4 / xfrm4_tunnel.c
index 9275c79119b6f32d9bb69c7c64d9be853378eb7b..326845195620dd07851907fdf03d65cadb0be220 100644 (file)
 
 static int ipip_output(struct xfrm_state *x, struct sk_buff *skb)
 {
-       struct iphdr *iph = ip_hdr(skb);
-
-       iph->tot_len = htons(skb->len);
-       ip_send_check(iph);
-
+       skb_push(skb, -skb_network_offset(skb));
        return 0;
 }
 
 static int ipip_xfrm_rcv(struct xfrm_state *x, struct sk_buff *skb)
 {
-       return 0;
+       return ip_hdr(skb)->protocol;
 }
 
 static int ipip_init_state(struct xfrm_state *x)
@@ -52,20 +48,25 @@ static struct xfrm_type ipip_type = {
        .output         = ipip_output
 };
 
+static int xfrm_tunnel_rcv(struct sk_buff *skb)
+{
+       return xfrm4_rcv_spi(skb, IPPROTO_IP, ip_hdr(skb)->saddr);
+}
+
 static int xfrm_tunnel_err(struct sk_buff *skb, u32 info)
 {
        return -ENOENT;
 }
 
 static struct xfrm_tunnel xfrm_tunnel_handler = {
-       .handler        =       xfrm4_rcv,
+       .handler        =       xfrm_tunnel_rcv,
        .err_handler    =       xfrm_tunnel_err,
        .priority       =       2,
 };
 
 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
 static struct xfrm_tunnel xfrm64_tunnel_handler = {
-       .handler        =       xfrm4_rcv,
+       .handler        =       xfrm_tunnel_rcv,
        .err_handler    =       xfrm_tunnel_err,
        .priority       =       2,
 };